]> git.mxchange.org Git - friendica.git/commitdiff
Diaspora: Bugfix for the hashtag detection of incoming posts
authorMichael Vogel <icarus@dabo.de>
Mon, 23 Feb 2015 23:12:30 +0000 (00:12 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 23 Feb 2015 23:12:30 +0000 (00:12 +0100)
include/diaspora.php

index a0d1fcd751ea114895e87f39d39e01f8c5ed310c..d464b5d679ff83612091c9fdeec5a332e0807246 100755 (executable)
@@ -834,6 +834,7 @@ function diaspora_post($importer,$xml,$msg) {
        $str_tags = '';
 
        $tags = get_tags($body);
+       rsort($tags);
 
        if(count($tags)) {
                foreach($tags as $tag) {
@@ -843,9 +844,9 @@ function diaspora_post($importer,$xml,$msg) {
 
                                // don't link tags that are already embedded in links
 
-                               if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
+                               if(preg_match('/\[(\S*?)' . preg_quote($tag,'/') . '(\S*?)\]/',$body))
                                        continue;
-                               if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
+                               if(preg_match('/\[(\S*?)\]\((\S*?)' . preg_quote($tag,'/') . '(\S*?)\)/',$body))
                                        continue;
 
                                $basetag = str_replace('_',' ',substr($tag,1));