summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2007-07-12 01:40:14 +0200
committerDerek Jones <derek.jones@ellislab.com>2007-07-12 01:40:14 +0200
commitc80593c537117b11e2f75287fc9a18e0d0d2bf5a (patch)
tree6103149cdda27aedd07bf13573daec62eca0475e /system/helpers/form_helper.php
parenteea2bdaaffcbee1a9efb56e60ae5712e30873f87 (diff)
type cast $key => $val pair in $options array as strings for friendlier handling of setting options as 'selected'
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r--system/helpers/form_helper.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 531ab66c0..263dc0f19 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -229,6 +229,9 @@ function form_dropdown($name = '', $options = array(), $selected = '', $extra =
foreach ($options as $key => $val)
{
+ $key = (string) $key;
+ $val = (string) $val;
+
$sel = ($selected != $key) ? '' : ' selected="selected"';
$form .= '<option value="'.$key.'"'.$sel.'>'.$val."</option>\n";