diff options
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/include/text.php b/include/text.php index cc084f6f1..4d9670806 100644 --- a/include/text.php +++ b/include/text.php @@ -72,10 +72,6 @@ function notags($string) { // return(str_replace(array("<",">","\xBA","\xBC","\xBE"), array('[',']','','',''), $string)); } -// use this on "body" or "content" input where angle chars shouldn't be removed, -// and allow them to be safely displayed. - - /** * use this on "body" or "content" input where angle chars shouldn't be removed, @@ -458,63 +454,7 @@ function alt_pager(&$a, $i, $more = '', $less = '') { } -/** - * @brief Turn user/group ACLs stored as angle bracketed text into arrays. - * - * turn string array of angle-bracketed elements into string array - * e.g. "<123xyz><246qyo><sxo33e>" => array(123xyz,246qyo,sxo33e); - * - * @param string $s - * @return array - */ -function expand_acl($s) { - $ret = array(); - - if(strlen($s)) { - $t = str_replace('<','',$s); - $a = explode('>',$t); - foreach($a as $aa) { - if($aa) - $ret[] = $aa; - } - } - - return $ret; -} -/** - * @brief Used to wrap ACL elements in angle brackets for storage. - * - * @param[in,out] array &$item - */ -function sanitise_acl(&$item) { - if (strlen($item)) - $item = '<' . notags(trim($item)) . '>'; - else - unset($item); -} - -/** - * @brief Convert an ACL array to a storable string. - * - * @param array $p - * @return array - */ -function perms2str($p) { - $ret = ''; - - if (is_array($p)) - $tmp = $p; - else - $tmp = explode(',', $p); - - if (is_array($tmp)) { - array_walk($tmp, 'sanitise_acl'); - $ret = implode('', $tmp); - } - - return $ret; -} /** * @brief Generate a guaranteed unique (for this domain) item ID for ATOM. @@ -1305,7 +1245,7 @@ function theme_attachments(&$item) { $title = htmlspecialchars($r['title'], ENT_COMPAT,'UTF-8'); if(! $title) $title = t('unknown.???'); - $title .= ' ' . $r['length'] . ' ' . t('bytes'); + $title .= ' ' . (($r['length']) ? $r['length'] . ' ' . t('bytes') : ''); require_once('include/identity.php'); if(is_foreigner($item['author_xchan'])) |