diff --git a/include/SearchPage.php b/include/SearchPage.php index cc87f75..2cbb9d6 100644 --- a/include/SearchPage.php +++ b/include/SearchPage.php @@ -103,27 +103,18 @@ class SearchPage extends Page { $sanitizedItems = array(); foreach($items as $item) { $mustMatch = $item->matches($mustMatchArray); - if($mustMatch) { + + $mustMatchCheck = array(); + foreach($mustIncludeArray as $mustIncludeTerm) { + if (array_key_exists($mustIncludeTerm, $mustMatchCheck)) { + $mustMatchCheck[] = True; + } else { + $mustMatchCheck[] = False; + } + } + if(in_array(False, $mustIncludeCheck, True) === False) { $sanitizedItems[] = array($item, $mustMatch); } - /* ============ - - if () { - - - - - } - else if () { - - - - } - else - - - */ - // $mustIncludeCheck = array(); // foreach($mustIncludeArray as $mustIncludeTerm) { // if ($item->matches($mustIncludeTerm)) {