From: friendica Date: Fri, 16 Dec 2011 09:42:45 +0000 (-0800) Subject: eliminate dup identical hashtags in posts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=efb9157490c38258106d8e33ae33b28a2e11788f;p=friendica.git eliminate dup identical hashtags in posts --- diff --git a/mod/item.php b/mod/item.php index 95a27eb8ea..f72b17fc12 100644 --- a/mod/item.php +++ b/mod/item.php @@ -398,9 +398,13 @@ function item_post(&$a) { continue; $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; + + $newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; + if(! stristr($str_tags,$newtag)) { + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } continue; } if(strpos($tag,'@') === 0) {