- bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049)

This commit is contained in:
rodneyrehm
2011-10-07 12:11:33 +00:00
parent 2fdb8c9bb5
commit 1bf1b05846
2 changed files with 10 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
- improvement removed html comments from {mailto} (Forum Topic 20092) - improvement removed html comments from {mailto} (Forum Topic 20092)
- bugfix testInstall() would not show path to internal plugins_dir (Forum Post 74627) - 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 - 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 06.10.2011
- bugfix switch lexer internals depending on mbstring.func_overload - bugfix switch lexer internals depending on mbstring.func_overload

View File

@@ -143,7 +143,15 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c
} }
$_html_class = !empty($class) ? ' class="'.$class.' option"' : ''; $_html_class = !empty($class) ? ' class="'.$class.' option"' : '';
$_html_id = !empty($id) ? ' id="'.$id.'-'.$idx.'"' : ''; $_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++; $idx++;
} else { } else {
$_idx = 0; $_idx = 0;