summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-13 11:05:52 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-13 11:05:52 +0200
commit6b114ae363eb94328b9d367492ae1b555a19a26c (patch)
tree2b6ef90dfe11af492c4a31801765ca6634318235
parent6648da07a4dc001d5e9d2c16e501d563e7fa2118 (diff)
Fix issue #1613
-rw-r--r--system/helpers/form_helper.php7
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 7 insertions, 1 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 0c5d55037..1bccac35c 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -340,8 +340,13 @@ if ( ! function_exists('form_dropdown'))
{
$key = (string) $key;
- if (is_array($val) && ! empty($val))
+ if (is_array($val))
{
+ if (empty($val))
+ {
+ continue;
+ }
+
$form .= '<optgroup label="'.$key."\">\n";
foreach ($val as $optgroup_key => $optgroup_val)
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 0e9ec5e50..0c605dc6a 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -314,6 +314,7 @@ Bug fixes for 3.0
- Fixed a bug (#1551) - :doc:`Date Helper <helpers/date_helper>` function ``standard_date()`` didn't properly format *W3C* and *ATOM* standard dates.
- Fixed a bug in :doc:`Query Builder <database/query_builder>` method join() where literal values were escaped as if they were fields.
- Fixed a bug (#135) - PHP Error logging was impossible without the errors being displayed.
+- Fixed a bug (#1613) - :doc:`Form Helper <helpers/form_helper>` functions ``form_multiselect()``, ``form_dropdown()`` didn't properly handle empty array option groups.
Version 2.1.2
=============