diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/input/dropdown.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/views/default/input/dropdown.php b/views/default/input/dropdown.php index 6fd97d3b5..fccccb888 100644 --- a/views/default/input/dropdown.php +++ b/views/default/input/dropdown.php @@ -3,7 +3,7 @@ * Elgg dropdown input * Displays a dropdown (select) input field * - * NB: Default values of FALSE or NULL will match '' (empty string) and not 0. + * @warning Default values of FALSE or NULL will match '' (empty string) and not 0. * * @package Elgg * @subpackage Core @@ -47,13 +47,15 @@ if ($options_values) { echo "<option $option_attrs>$option</option>"; } } else { - foreach ($options as $option) { + if (is_array($options)) { + foreach ($options as $option) { - $option_attrs = elgg_format_attributes(array( - 'selected' => (string)$option == (string)$value - )); + $option_attrs = elgg_format_attributes(array( + 'selected' => (string)$option == (string)$value + )); - echo "<option $option_attrs>$option</option>"; + echo "<option $option_attrs>$option</option>"; + } } } ?> |