Only set val from cookie if it is non-empty

pull/3698/head
Isaac Connor 2023-04-26 11:07:17 -04:00
parent 886bac0888
commit 7825957114
1 changed files with 2 additions and 1 deletions

View File

@ -1085,7 +1085,8 @@ class Filter extends ZM_Object {
if (isset($term['cookie'])) {
$options['data-cookie'] = $term['cookie'];
if (!$selected and isset($_COOKIE[$term['cookie']])) $selected = explode(',', $_COOKIE[$term['cookie']]);
if (!$selected and isset($_COOKIE[$term['cookie']]) and $_COOKIE[$term['cookie']])
$selected = explode(',', $_COOKIE[$term['cookie']]);
}
#$html .= '<span>'.htmlSelect("filter[Query][terms][$i][op]", $opTypes, $term['op']).'</span>'.PHP_EOL;
$html .= '<span>'.htmlSelect("filter[Query][terms][$i][val]", $monitors, $selected, $options).'</span>'.PHP_EOL;