summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-01-05 17:31:59 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-01-05 17:31:59 +0100
commit5c561805bd9ae6a4ad5d202277c34a879617b683 (patch)
treece6fb66d7df410d45bce84e6d0df5b8b042c27e3 /system/libraries
parent865d46f31b52727c7885aa4b92f7cb4041fc05fe (diff)
If the data is an array output them one at a time. E.g: form_input('name[]', set_value('name[]');
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Form_validation.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 38f50fa41..f45760024 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -736,6 +736,13 @@ class CI_Form_validation {
return $default;
}
+ // If the data is an array output them one at a time.
+ // E.g: form_input('name[]', set_value('name[]');
+ if (is_array($this->_field_data[$field]['postdata']))
+ {
+ return array_shift($this->_field_data[$field]['postdata']);
+ }
+
return $this->_field_data[$field]['postdata'];
}