aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-11-02 18:52:55 -0700
committerFriendika <info@friendika.com>2011-11-02 18:52:55 -0700
commita9ec56ace1756726517650d96192df5320f445fe (patch)
tree1efd4cae66a66932e884c1dbd13f95f6b1f8da4d /mod
parent8582701b70d2ae668086efe3a35a0c9cccf085d8 (diff)
downloadvolse-hubzilla-a9ec56ace1756726517650d96192df5320f445fe.tar.gz
volse-hubzilla-a9ec56ace1756726517650d96192df5320f445fe.tar.bz2
volse-hubzilla-a9ec56ace1756726517650d96192df5320f445fe.zip
prevent duplicate @ tags
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/mod/item.php b/mod/item.php
index 3af0f799a..48bfb7751 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -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;
+ }
}
}
}