- // Exclude terms.
- for ($i = 0; $i < count($excludeSearch) && $found; $i++) {
- $found = strpos($haystack, $excludeSearch[$i]) === false;
- }
-
- // One of the fields of the link matches, no need to check the other.
- if ($found) {
- break;
- }
+ // First, we look for exact term search
+ for ($i = 0; $i < count($exactSearch) && $found; $i++) {
+ $found = strpos($content, $exactSearch[$i]) !== false;
+ }
+
+ // Iterate over keywords, if keyword is not found,
+ // no need to check for the others. We want all or nothing.
+ for ($i = 0; $i < count($andSearch) && $found; $i++) {
+ $found = strpos($content, $andSearch[$i]) !== false;