mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
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:
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
||||
- fix bug when comparing array-keys to "selected" in html_options
|
||||
and html_checkboxes (messju)
|
||||
- add better checks for correctly nested tags when compiling (messju)
|
||||
- remove {$SCRIPT_NAME}. use {$smarty.server.SCRIPT_NAME} instead (messju)
|
||||
- remove $global_assign. assign global variables explicitly instead (messju)
|
||||
|
@@ -122,7 +122,7 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
|
||||
. smarty_function_escape_special_chars($name) . '[]" value="'
|
||||
. smarty_function_escape_special_chars($value) . '"';
|
||||
|
||||
if (in_array($value, $selected)) {
|
||||
if (in_array($value, $selected, true)) {
|
||||
$_output .= ' checked="checked"';
|
||||
}
|
||||
$_output .= $extra . ' />' . $output;
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user