summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-03-12 14:43:22 +0100
committerAndrey Andreev <narf@devilix.net>2016-03-12 14:43:22 +0100
commit55a40b769b5e3350d07b63264b332fce5e1341d2 (patch)
tree464052355bab2846b62afbededee4e336e8999a9 /system/libraries
parenta0556f128417467faaa7048bb1bf8da154e79582 (diff)
A small memory optimization to CI_Form_validation
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Form_validation.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 09d6c9a97..9fb686892 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -450,7 +450,7 @@ class CI_Form_validation {
$this->CI->lang->load('form_validation');
// Cycle through the rules for each field and match the corresponding $validation_data item
- foreach ($this->_field_data as $field => $row)
+ foreach ($this->_field_data as $field => &$row)
{
// Fetch the data from the validation_data array item and cache it in the _field_data array.
// Depending on whether the field name is an array or a string will determine where we get it from.
@@ -467,7 +467,7 @@ class CI_Form_validation {
// Execute validation rules
// Note: A second foreach (for now) is required in order to avoid false-positives
// for rules like 'matches', which correlate to other validation fields.
- foreach ($this->_field_data as $field => $row)
+ foreach ($this->_field_data as $field => &$row)
{
// Don't try to validate if we have no rules set
if (empty($row['rules']))
@@ -475,7 +475,7 @@ class CI_Form_validation {
continue;
}
- $this->_execute($row, $row['rules'], $this->_field_data[$field]['postdata']);
+ $this->_execute($row, $row['rules'], $row['postdata']);
}
// Did we end up with any errors?