summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
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'];
}