mirror of https://github.com/MISP/MISP
Fix to the highlight issue
- new line at the end of the search list would break the highlighter and throw a warning - fixedpull/195/head
parent
4ce6ec9a46
commit
f2a5efc9d4
|
@ -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[] = '<span style="color:red">'.$keywordArrayElement.'</span>';
|
||||
}
|
||||
if (!empty($replacementArray))
|
||||
|
|
Loading…
Reference in New Issue