aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-06 23:57:28 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-06 23:57:28 +0200
commit07cd0c870f48ec838c23fa7c6966ceb1c41f06ab (patch)
tree26a1177441c40c2d3e42d3fc3617302dc2d86f12 /include/items.php
parent2b1e6723168665039cdccb951e29c4220351367a (diff)
parent1b0cb9388cd5c416af5ba270127b14efdd1c0a6b (diff)
downloadvolse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.tar.gz
volse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.tar.bz2
volse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/items.php b/include/items.php
index 30cde0745..c1b50da22 100755
--- a/include/items.php
+++ b/include/items.php
@@ -159,7 +159,7 @@ function filter_insecure($channel_id, $arr) {
$ret = array();
- if((! intval(get_config($channel_id, 'system', 'filter_insecure_collections'))) || (! $arr))
+ if((! intval(get_pconfig($channel_id, 'system', 'filter_insecure_collections'))) || (! $arr))
return $arr;
$str = '';
@@ -3338,6 +3338,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;
@@ -3352,10 +3355,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;
@@ -3380,6 +3383,9 @@ function post_is_importable($item,$abook) {
return true;
require_once('include/html2plain.php');
+
+ unobscure($item);
+
$text = prepare_text($item['body'],$item['mimetype']);
$text = html2plain($text);
@@ -3399,10 +3405,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 +3424,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;