cvs: smarty / NEWS /libs/plugins function.html_checkboxes.php function.html_options.php
"Messju Mohr" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmessju1070998705@cvsserver> |
messju Tue Dec 9 14:38:25 2003 EDT
Modified files:
/smarty NEWS
/smarty/libs/plugins function.html_checkboxes.php
function.html_options.php
Log:
fix bug when comparing array-keys to "selected" in html_options and
html_checkboxes
in_array() uses "strict" comparason now.
Index: smarty/NEWS
diff -u smarty/NEWS:1.411 smarty/NEWS:1.412
--- smarty/NEWS:1.411 Mon Dec 8 05:44:21 2003
+++ smarty/NEWS Tue Dec 9 14:38:23 2003
@@ -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)
Index: smarty/libs/plugins/function.html_checkboxes.php
diff -u smarty/libs/plugins/function.html_checkboxes.php:1.11 smarty/libs/plugins/function.html_checkboxes.php:1.12
--- smarty/libs/plugins/function.html_checkboxes.php:1.11 Tue Dec 9 14:30:28 2003
+++ smarty/libs/plugins/function.html_checkboxes.php Tue Dec 9 14:38:25 2003
@@ -122,7 +122,7 @@
. 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;
Index: smarty/libs/plugins/function.html_options.php
diff -u smarty/libs/plugins/function.html_options.php:1.19 smarty/libs/plugins/function.html_options.php:1.20
--- smarty/libs/plugins/function.html_options.php:1.19 Tue Dec 9 14:30:29 2003
+++ smarty/libs/plugins/function.html_options.php Tue Dec 9 14:38:25 2003
@@ -95,7 +95,7 @@
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 {
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php