diff --git a/app/View/Attributes/index.ctp b/app/View/Attributes/index.ctp index c2f2b08ed..ef965d848 100755 --- a/app/View/Attributes/index.ctp +++ b/app/View/Attributes/index.ctp @@ -25,9 +25,12 @@ if ($isSearch == 1) { if ($isSearch == 1) { // build the $replacePairs variable used to highlight the keywords $replacementArray = array(); - foreach ($keywordArray as &$keywordArrayElement) { + foreach ($keywordArray as $k => &$keywordArrayElement) { $keywordArrayElement = trim($keywordArrayElement); - if ("" == $keywordArrayElement) continue; + if ("" == $keywordArrayElement) { + unset($keywordArray[$k]); + continue; + } $replacementArray[] = ''.$keywordArrayElement.''; } if (!empty($replacementArray))