diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-05 16:12:05 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-05 16:12:05 -0700 |
commit | 6413ba323049820abede854bb7839d2f81073e7f (patch) | |
tree | 762e36b509afbb667a086e5991432b7ebdfe2482 /include/items.php | |
parent | a61fc00fa495e144fbfadb354b7b82c3abc4b721 (diff) | |
download | volse-hubzilla-6413ba323049820abede854bb7839d2f81073e7f.tar.gz volse-hubzilla-6413ba323049820abede854bb7839d2f81073e7f.tar.bz2 volse-hubzilla-6413ba323049820abede854bb7839d2f81073e7f.zip |
connection filter fixes
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php index 856954a57..1551a069a 100755 --- a/include/items.php +++ b/include/items.php @@ -3335,6 +3335,9 @@ function check_item_source($uid, $item) { if($r[0]['src_channel_xchan'] === $item['owner_xchan']) return false; + + // since we now have connection filters with more features, the source filter is redundant and can probably go away + if(! $r[0]['src_patt']) return true; @@ -3349,10 +3352,10 @@ function check_item_source($uid, $item) { foreach($words as $word) { if(substr($word,0,1) === '#' && $tags) { foreach($tags as $t) - if(($t['type'] == TERM_HASHTAG) && ((substr($t,1) === substr($word,1)) || (substr($word,1) === '*'))) + if(($t['type'] == TERM_HASHTAG) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*'))) return true; } - elseif((strpos($word,'/') === 0) && preg_match($word,$body)) + elseif((strpos($word,'/') === 0) && preg_match($word,$text)) return true; elseif(stristr($text,$word) !== false) return true; @@ -3399,10 +3402,10 @@ function post_is_importable($item,$abook) { $word = trim($word); if(substr($word,0,1) === '#' && $tags) { foreach($tags as $t) - if(($t['type'] == TERM_HASHTAG) && ((substr($t,1) === substr($word,1)) || (substr($word,1) === '*'))) + if(($t['type'] == TERM_HASHTAG) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*'))) return false; } - elseif((strpos($word,'/') === 0) && preg_match($word,$body)) + elseif((strpos($word,'/') === 0) && preg_match($word,$text)) return false; elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0)) return false; @@ -3418,10 +3421,10 @@ function post_is_importable($item,$abook) { $word = trim($word); if(substr($word,0,1) === '#' && $tags) { foreach($tags as $t) - if(($t['type'] == TERM_HASHTAG) && ((substr($t,1) === substr($word,1)) || (substr($word,1) === '*'))) + if(($t['type'] == TERM_HASHTAG) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*'))) return true; } - elseif((strpos($word,'/') === 0) && preg_match($word,$body)) + elseif((strpos($word,'/') === 0) && preg_match($word,$text)) return true; elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0)) return true; |