From 4b3c56517446aa4f04c78887794cb49bda20c086 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 26 Sep 2013 19:58:24 -0700 Subject: [PATCH] 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. --- include/items.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 0e38de319..79229acfe 100755 --- a/include/items.php +++ b/include/items.php @@ -2313,6 +2313,10 @@ function check_item_source($uid,$item) { if(! $r[0]['src_patt']) return true; + require_once('include/html2plain.php'); + $text = prepare_text($item['body'],$item['mimetype']); + $text = html2plain($text); + $tags = ((count($items['term'])) ? $items['term'] : false); $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) return true; } - if(stristr($item['body'],$word) !== false) + if(stristr($text,$word) !== false) return true; } }