diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php
index 05fe63c0..6fd272a0 100644
--- a/libs/plugins/function.html_checkboxes.php
+++ b/libs/plugins/function.html_checkboxes.php
@@ -73,7 +73,7 @@ function smarty_function_html_checkboxes($params, &$smarty)
case 'checked':
case 'selected':
- $selected = array_values((array)$_val);
+ $selected = array_map('strval', array_values((array)$_val));
break;
case 'checkboxes':
@@ -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, true)) {
+ if (in_array((string)$value, $selected)) {
$_output .= ' checked="checked"';
}
$_output .= $extra . ' />' . $output;
diff --git a/libs/plugins/function.html_options.php b/libs/plugins/function.html_options.php
index fab21753..da5571c5 100644
--- a/libs/plugins/function.html_options.php
+++ b/libs/plugins/function.html_options.php
@@ -48,11 +48,14 @@ function smarty_function_html_options($params, &$smarty)
$$_key = (array)$_val;
break;
- case 'selected':
case 'values':
case 'output':
$$_key = array_values((array)$_val);
break;
+
+ case 'selected':
+ $$_key = array_map('strval', array_values((array)$_val));
+ break;
default:
if(!is_array($_val)) {
@@ -95,7 +98,7 @@ function smarty_function_html_options_optoutput($key, $value, $selected) {
if(!is_array($value)) {
$_html_result = '