diff --git a/base.php b/base.php index 71b85de..da9e926 100644 --- a/base.php +++ b/base.php @@ -384,6 +384,7 @@ function matches_comparing_expression($expr, $text) { if (gettype($expr) === 'string') $expr = parse_comparing_expression($expr); $result = $expr['original']; + $text_words = explode(' ', $text); foreach ($expr['parsed'] as $lvl => $exl) { foreach ($exl as &$t) { if (strpos($t, 'words ') === 0) { @@ -391,7 +392,7 @@ function matches_comparing_expression($expr, $text) { $ws = explode(' ', trim(trim($w, '"'))); $haveall = true; foreach ($ws as $w) { - if (strpos($text, $w) === false) { + if (!in_array(normalize_for_search($w), $text_words)) { $haveall = false; break; } @@ -400,7 +401,7 @@ function matches_comparing_expression($expr, $text) { } else if (strpos($t, 'contains ') === 0) { $w = substr($t, strlen('contains')+1); $w = trim(trim($w, '"')); - $contains = strpos($text, $w) !== false; + $contains = strpos($text, normalize_for_search($w)) !== false; $result = str_replace($t, $contains ? 'true' : 'false', $result); } }