convert to plaintext before matching words in body. Otherwise every post I make with a link in it is going to match a test for zot.

This commit is contained in:
friendica 2013-09-26 19:58:24 -07:00
parent 6dc4d963fa
commit 4b3c565174

View File

@ -2313,6 +2313,10 @@ function check_item_source($uid,$item) {
if(! $r[0]['src_patt']) if(! $r[0]['src_patt'])
return true; return true;
require_once('include/html2plain.php');
$text = prepare_text($item['body'],$item['mimetype']);
$text = html2plain($text);
$tags = ((count($items['term'])) ? $items['term'] : false); $tags = ((count($items['term'])) ? $items['term'] : false);
$words = explode("\n",$r[0]['src_patt']); $words = explode("\n",$r[0]['src_patt']);
@ -2323,7 +2327,7 @@ function check_item_source($uid,$item) {
if($t['type'] == TERM_HASHTAG && substr($t,1) === $word) if($t['type'] == TERM_HASHTAG && substr($t,1) === $word)
return true; return true;
} }
if(stristr($item['body'],$word) !== false) if(stristr($text,$word) !== false)
return true; return true;
} }
} }