Fix code warning if no value is selected in htmlSelect
This commit is contained in:
parent
47971bb8f5
commit
240f4ceabd
|
@ -520,8 +520,9 @@ function htmlOptions($options, $values) {
|
|||
} else {
|
||||
$text = $option;
|
||||
}
|
||||
$selected = is_array($values) ? in_array($value, $values) : !strcmp($value, $values);
|
||||
$has_selected = (!$has_selected) && $selected;
|
||||
$selected = is_array($values) ? in_array($value, $values) : (!strcmp($value, $values));
|
||||
if ( !$has_selected )
|
||||
$has_selected = $selected;
|
||||
|
||||
$options_html .= '<option value="'.htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, ini_get('default_charset'), false).'"'.
|
||||
($selected?' selected="selected"':'').
|
||||
|
|
Loading…
Reference in New Issue