mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
- improvement removed html comments from {mailto} (Forum Topic 20092)
|
||||
- bugfix testInstall() would not show path to internal plugins_dir (Forum Post 74627)
|
||||
- improvement testInstall() now showing resolved paths and checking the include_path if necessary
|
||||
- bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049)
|
||||
|
||||
06.10.2011
|
||||
- bugfix switch lexer internals depending on mbstring.func_overload
|
||||
|
@@ -143,7 +143,15 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c
|
||||
}
|
||||
$_html_class = !empty($class) ? ' class="'.$class.' option"' : '';
|
||||
$_html_id = !empty($id) ? ' id="'.$id.'-'.$idx.'"' : '';
|
||||
$_html_result .= $_html_class . $_html_id . '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
|
||||
if (is_object($value)) {
|
||||
if (method_exists($value, "__toString")) {
|
||||
$value = smarty_function_escape_special_chars((string) $value->__toString());
|
||||
} else {
|
||||
trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
$_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . "\n";
|
||||
$idx++;
|
||||
} else {
|
||||
$_idx = 0;
|
||||
|
Reference in New Issue
Block a user