diff options
author | friendica <info@friendica.com> | 2013-09-26 19:58:24 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-09-26 19:58:24 -0700 |
commit | 4b3c56517446aa4f04c78887794cb49bda20c086 (patch) | |
tree | 130dc3100345b4269c55c0176517d35ee7484eca | |
parent | 6dc4d963fa510d873188226941456b4e4fa4e766 (diff) | |
download | volse-hubzilla-4b3c56517446aa4f04c78887794cb49bda20c086.tar.gz volse-hubzilla-4b3c56517446aa4f04c78887794cb49bda20c086.tar.bz2 volse-hubzilla-4b3c56517446aa4f04c78887794cb49bda20c086.zip |
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.
-rwxr-xr-x | include/items.php | 6 |
1 files changed, 5 insertions, 1 deletions
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; } } |