]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
Merge branch 'master' into groups
[friendica.git] / include / text.php
index ca8dc5ac3b474569b793a97e555cec979ae0378c..08803cc9b7be5b54bb7f4b9ceb8b6e980e520939 100644 (file)
@@ -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(
                '<img src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />',
                '<img src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" />',
@@ -691,6 +691,7 @@ function smilies($s) {
                '<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" />',
                '<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" />',
                '<a href="http://project.friendika.com">~friendika <img src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendika" /></a>',
+               '<a href="http://friendica.com">~friendica <img src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendica" /></a>',
                '<a href="http://diasporafoundation.org">Diaspora<img src="' . $a->get_baseurl() . '/images/diaspora.png" alt="Diaspora*" /></a>',
 
        ), $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,11 @@ function prepare_body($item,$attach = false) {
                }
                $s .= '<div class="clear"></div></div>';
        }
-       call_hooks('prepare_body_final', $s);
-       return $s;
+
+
+       $prep_arr = array('item' => $item, 'html' => $s);
+       call_hooks('prepare_body_final', $prep_arr);
+       return $prep_arr['html'];
 }}
 
 
@@ -1039,4 +1045,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);
+}