]> git.mxchange.org Git - friendica.git/commitdiff
prevent duplicate @ tags
authorFriendika <info@friendika.com>
Thu, 3 Nov 2011 01:52:55 +0000 (18:52 -0700)
committerFriendika <info@friendika.com>
Thu, 3 Nov 2011 01:52:55 +0000 (18:52 -0700)
boot.php
mod/item.php

index c8d667f589c33f88e171cad4936c06684deafb44..9932f0430ad6b5068e4f5ecc66924f9bb18a3669 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDIKA_PLATFORM',     'Friendica');
-define ( 'FRIENDIKA_VERSION',      '2.3.1152' );
+define ( 'FRIENDIKA_VERSION',      '2.3.1153' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
 define ( 'DB_UPDATE_VERSION',      1101      );
 
index 3af0f799a12da6c8dbb1c8907f4e003296d7cc56..48bfb7751fe9c7bd807d14713570ef90723333df 100644 (file)
@@ -455,17 +455,23 @@ function item_post(&$a) {
                                if($profile) {
                                        $body = str_replace('@' . $name, '@' . '[url=' . $profile . ']' . $newname      . '[/url]', $body);
                                        $profile = str_replace(',','%2c',$profile);
-                                       if(strlen($str_tags))
-                                               $str_tags .= ',';
-                                       $str_tags .= '@[url=' . $profile . ']' . $newname       . '[/url]';
+                                       $newtag = '@[url=' . $profile . ']' . $newname  . '[/url]';
+                                       if(! stristr($str_tags,$newtag)) {
+                                               if(strlen($str_tags))
+                                                       $str_tags .= ',';
+                                               $str_tags .= $newtag;
+                                       }
 
                                        // Status.Net seems to require the numeric ID URL in a mention if the person isn't 
                                        // subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both. 
 
                                        if(strlen($alias)) {
-                                               if(strlen($str_tags))
-                                                       $str_tags .= ',';
-                                               $str_tags .= '@[url=' . $alias . ']' . $newname . '[/url]';
+                                               $newtag = '@[url=' . $alias . ']' . $newname    . '[/url]';
+                                               if(! stristr($str_tags,$newtag)) {
+                                                       if(strlen($str_tags))
+                                                               $str_tags .= ',';
+                                                       $str_tags .= $newtag;
+                                               }
                                        }
                                }
                        }