diff options
author | friendica <info@friendica.com> | 2011-12-16 01:42:45 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2011-12-16 01:42:45 -0800 |
commit | efb9157490c38258106d8e33ae33b28a2e11788f (patch) | |
tree | 986fbc1d0fd3b5e69e4b01fedfdc60391f12257e /mod/item.php | |
parent | 193435e9803b29555772f19e45283eb411f91f8b (diff) | |
download | volse-hubzilla-efb9157490c38258106d8e33ae33b28a2e11788f.tar.gz volse-hubzilla-efb9157490c38258106d8e33ae33b28a2e11788f.tar.bz2 volse-hubzilla-efb9157490c38258106d8e33ae33b28a2e11788f.zip |
eliminate dup identical hashtags in posts
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mod/item.php b/mod/item.php index 95a27eb8e..f72b17fc1 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) { |