fix bug when comparing array-keys to "selected" in html_options and

html_checkboxes

in_array() uses "strict" comparason now.
This commit is contained in:
messju
2003-12-09 19:38:25 +00:00
parent 37575a1982
commit aa2ee3cd66
3 changed files with 4 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ function smarty_function_html_options_optoutput($key, $value, $selected) {
if(!is_array($value)) {
$_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
smarty_function_escape_special_chars($key) . '"';
if (in_array($key, $selected))
if (in_array($key, $selected, true))
$_html_result .= ' selected="selected"';
$_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
} else {