From 07e6982d1d58ac211f23d98d51501441efb51a33 Mon Sep 17 00:00:00 2001 From: messju Date: Tue, 16 Nov 2004 08:05:21 +0000 Subject: [PATCH] cleaned up typecasting --- libs/plugins/function.html_checkboxes.php | 2 +- libs/plugins/function.html_radios.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php index a64d7db7..7fda3981 100644 --- a/libs/plugins/function.html_checkboxes.php +++ b/libs/plugins/function.html_checkboxes.php @@ -101,7 +101,7 @@ function smarty_function_html_checkboxes($params, &$smarty) settype($selected, 'array'); $_html_result = array(); - if (is_array($options)) { + if (isset($options)) { foreach ($options as $_key=>$_val) $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); diff --git a/libs/plugins/function.html_radios.php b/libs/plugins/function.html_radios.php index c8633c5d..d302cdb1 100644 --- a/libs/plugins/function.html_radios.php +++ b/libs/plugins/function.html_radios.php @@ -103,14 +103,14 @@ function smarty_function_html_radios($params, &$smarty) $_html_result = array(); - if (isset($options) && is_array($options)) { + if (isset($options))) { - foreach ((array)$options as $_key=>$_val) + foreach ($options as $_key=>$_val) $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels); } else { - foreach ((array)$values as $_i=>$_key) { + foreach ($values as $_i=>$_key) { $_val = isset($output[$_i]) ? $output[$_i] : ''; $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels); }