diff options
author | Daniel Paul Searles <daniel.paul.searles@gmail.com> | 2012-11-05 23:34:50 +0100 |
---|---|---|
committer | Daniel Paul Searles <daniel.paul.searles@gmail.com> | 2012-11-05 23:34:50 +0100 |
commit | 0e4069ba30922941917a26463cba250b0f14c8ef (patch) | |
tree | 76a7de06b6f8b07ab36ebaffe78235f22dffb1a2 /system/libraries | |
parent | 3aca5695b2b8561986d11e20e6da46f9b32060f1 (diff) | |
parent | d743cdbe448258cc7f02abf15e8dc797dc6403eb (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Form_validation.php | 11 | ||||
-rw-r--r-- | system/libraries/Log.php | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 50708c7d8..e50eee4f2 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -440,11 +440,10 @@ class CI_Form_validation { // Load the language file containing error messages $this->CI->lang->load('form_validation'); - // Cycle through the rules for each field, match the - // corresponding $_POST item and test for errors + // Cycle through the rules for each field and match the corresponding $validation_data item foreach ($this->_field_data as $field => $row) { - // Fetch the data from the corresponding $_POST or validation array and cache it in the _field_data array. + // 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. if ($row['is_array'] === TRUE) { @@ -454,7 +453,13 @@ class CI_Form_validation { { $this->_field_data[$field]['postdata'] = $validation_array[$field]; } + } + // 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) + { // Don't try to validate if we have no rules set if (empty($row['rules'])) { diff --git a/system/libraries/Log.php b/system/libraries/Log.php index a4dd47f86..e66270840 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -152,7 +152,7 @@ class CI_Log { if ( ! file_exists($filepath)) { $newfile = TRUE; - $message .= '<'."?php if defined('BASEPATH') OR exit('No direct script access allowed'); ?".">\n\n"; + $message .= '<'."?php defined('BASEPATH') OR exit('No direct script access allowed'); ?".">\n\n"; } if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) |