]> git.mxchange.org Git - friendica.git/commitdiff
don't use hashtags for FB message link
authorFriendika <info@friendika.com>
Fri, 20 May 2011 08:48:59 +0000 (01:48 -0700)
committerFriendika <info@friendika.com>
Fri, 20 May 2011 08:48:59 +0000 (01:48 -0700)
addon/facebook/facebook.php

index cf2bfe4343d9de797fa58cfb3587daccfe09bd09..667b2ce6f2ab52123f27dc90aa25ee7539f3e41f 100644 (file)
@@ -479,11 +479,17 @@ function facebook_post_hook(&$a,&$b) {
                                if($b['verb'] == ACTIVITY_DISLIKE)
                                        $msg = trim(strip_tags(bbcode($msg)));
 
+                               $search_str = $a->get_baseurl() . '/search';
+
                                if(preg_match("/\[url=(.+?)\](.+?)\[\/url\]/is",$msg,$matches)) {
 
-                                       $link = $matches[1];
-                                       if(substr($matches[2],0,5) != '[img]' )
-                                               $linkname = $matches[2];
+                                       // don't use hashtags for message link
+
+                                       if(strpos($matches[2],$search_str) === false) {
+                                               $link = $matches[1];
+                                               if(substr($matches[2],0,5) != '[img]')
+                                                       $linkname = $matches[2];
+                                       }
                                }
 
                                $msg = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is",'$2 $1',$msg);