diff options
author | zotlabs <mike@macgirvin.com> | 2018-01-22 11:58:12 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-01-22 11:58:12 -0800 |
commit | deede8e2ddb58db0bedf437f25c56c9fc050f181 (patch) | |
tree | f87c01f83284d5d54e58d6450e7b756795f14b90 /include | |
parent | c994f26dbd8151bd1e937dbb13d3ae416740fdd9 (diff) | |
parent | f85c6d76de5532e62f95de3f4d814109ea3472f9 (diff) | |
download | volse-hubzilla-deede8e2ddb58db0bedf437f25c56c9fc050f181.tar.gz volse-hubzilla-deede8e2ddb58db0bedf437f25c56c9fc050f181.tar.bz2 volse-hubzilla-deede8e2ddb58db0bedf437f25c56c9fc050f181.zip |
Merge branch 'dev'
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php index d0b9cffc9..b12ad1d85 100755 --- a/include/items.php +++ b/include/items.php @@ -3009,14 +3009,17 @@ function check_item_source($uid, $item) { $words = explode("\n",$r[0]['src_patt']); if($words) { foreach($words as $word) { - if(substr($word,0,1) === '#' && $tags) { + $w = trim($word); + if(! $w) + continue; + if(substr($w,0,1) === '#' && $tags) { foreach($tags as $t) - if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*'))) + if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($w,1)) || (substr($w,1) === '*'))) return true; } - elseif((strpos($word,'/') === 0) && preg_match($word,$text)) + elseif((strpos($w,'/') === 0) && preg_match($w,$text)) return true; - elseif(stristr($text,$word) !== false) + elseif(stristr($text,$w) !== false) return true; } } |