X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=59fc1500746a5f6b213efc4c3230b0564631a74c;hb=a1a07e7287e9e764912bbd08383cf43503deb9e8;hp=ca8dc5ac3b474569b793a97e555cec979ae0378c;hpb=ea9d3b06f6dbe2d7bf036ea1785a1e472f6bf890;p=friendica.git diff --git a/include/text.php b/include/text.php index ca8dc5ac3b..59fc150074 100644 --- a/include/text.php +++ b/include/text.php @@ -465,7 +465,7 @@ function get_tags($s) { // Match full names against @tags including the space between first and last // We will look these up afterward to see if they are full names or not recognisable. - if(preg_match_all('/(@[^ \x0D\x0A,:?]+ [^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) { + if(preg_match_all('/(@[^ \x0D\x0A,:?]+ [^ \x0D\x0A@,:?]+)([ \x0D\x0A@,:?]|$)/',$s,$match)) { foreach($match[1] as $mtch) { if(strstr($mtch,"]")) { // we might be inside a bbcode color tag - leave it alone @@ -481,7 +481,7 @@ function get_tags($s) { // Otherwise pull out single word tags. These can be @nickname, @first_last // and #hash tags. - if(preg_match_all('/([@#][^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) { + if(preg_match_all('/([@#][^ \x0D\x0A,;:?]+)([ \x0D\x0A,;:?]|$)/',$s,$match)) { foreach($match[1] as $mtch) { if(strstr($mtch,"]")) { // we might be inside a bbcode color tag - leave it alone @@ -672,7 +672,7 @@ function smilies($s) { $s = str_replace( array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', - '~friendika', 'Diaspora*' ), + '~friendika', '~friendica', 'Diaspora*' ), array( '<3', '</3', @@ -691,6 +691,7 @@ function smilies($s) { '8-|', '8-O', '~friendika ~friendika', + '~friendica ~friendica', 'DiasporaDiaspora*', ), $s); @@ -751,7 +752,9 @@ function prepare_body($item,$attach = false) { $s = prepare_text($item['body']); - call_hooks('prepare_body', $s); + $prep_arr = array('item' => $item, 'html' => $s); + call_hooks('prepare_body', $prep_arr); + $s = $prep_arr['html']; if(! $attach) return $s; @@ -784,8 +787,19 @@ function prepare_body($item,$attach = false) { } $s .= '
'; } - call_hooks('prepare_body_final', $s); - return $s; + + $arr = explode(',',$item['tag']); + if(count($arr)) { + $s .= '
'; + foreach($arr as $r) { + $s .= bbcode($r) . ' '; + } + $s .= '
'; + } + + $prep_arr = array('item' => $item, 'html' => $s); + call_hooks('prepare_body_final', $prep_arr); + return $prep_arr['html']; }} @@ -1039,4 +1053,13 @@ function html2bb_video($s) { '[vimeo]$2[/vimeo]', $s); return $s; -} \ No newline at end of file +} + +/** + * apply xmlify() to all values of array $val, recursively + */ +function array_xmlify($val){ + if (is_bool($val)) return $val?"true":"false"; + if (is_array($val)) return array_map('array_xmlify', $val); + return xmlify((string) $val); +}