aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-16 01:42:45 -0800
committerfriendica <info@friendica.com>2011-12-16 01:42:45 -0800
commitefb9157490c38258106d8e33ae33b28a2e11788f (patch)
tree986fbc1d0fd3b5e69e4b01fedfdc60391f12257e /mod
parent193435e9803b29555772f19e45283eb411f91f8b (diff)
downloadvolse-hubzilla-efb9157490c38258106d8e33ae33b28a2e11788f.tar.gz
volse-hubzilla-efb9157490c38258106d8e33ae33b28a2e11788f.tar.bz2
volse-hubzilla-efb9157490c38258106d8e33ae33b28a2e11788f.zip
eliminate dup identical hashtags in posts
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php10
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) {