summaryrefslogtreecommitdiff
path: root/kohana/helpers/form.php
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/helpers/form.php')
-rw-r--r--kohana/helpers/form.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/kohana/helpers/form.php b/kohana/helpers/form.php
index 30753f1e..5162a1ad 100644
--- a/kohana/helpers/form.php
+++ b/kohana/helpers/form.php
@@ -241,6 +241,7 @@ class form_Core {
*/
public static function dropdown($data, $options = NULL, $selected = NULL, $extra = '')
{
+
if ( ! is_array($data))
{
$data = array('name' => $data);
@@ -266,6 +267,9 @@ class form_Core {
// Key should always be a string
$key = (string) $key;
+ // Selected must always be a string
+ $selected = (string) $selected;
+
if (is_array($val))
{
$input .= '<optgroup label="'.$key.'">'."\n";