diff options
author | vlakoff <vlakoff@gmail.com> | 2013-01-14 01:30:09 +0100 |
---|---|---|
committer | vlakoff <vlakoff@gmail.com> | 2013-01-14 01:30:09 +0100 |
commit | 1228fe27bc1f22838cd80c5fe33c37274faf0e24 (patch) | |
tree | 897f37e872fde0863b36a70effc9441ac0dfb529 /system/libraries/Form_validation.php | |
parent | 5a519db2c4884a3972dd33e09d0b3a314aa222e2 (diff) |
Replace is_null() with === / !== NULL
Exact same behavior, but faster. I also think it's more readable.
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index c405eb6b1..bbd0b523e 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -511,7 +511,7 @@ class CI_Form_validation { { foreach ($this->_field_data as $field => $row) { - if ( ! is_null($row['postdata'])) + if ($row['postdata'] !== NULL) { if ($row['is_array'] === FALSE) { @@ -583,7 +583,7 @@ class CI_Form_validation { // If the field is blank, but NOT required, no further tests are necessary $callback = FALSE; - if ( ! in_array('required', $rules) && is_null($postdata)) + if ( ! in_array('required', $rules) && $postdata === NULL) { // Before we bail out, does the rule contain a callback? if (preg_match('/(callback_\w+(\[.*?\])?)/', implode(' ', $rules), $match)) @@ -598,7 +598,7 @@ class CI_Form_validation { } // Isset Test. Typically this rule will only apply to checkboxes. - if (is_null($postdata) && $callback === FALSE) + if ($postdata === NULL && $callback === FALSE) { if (in_array('isset', $rules, TRUE) OR in_array('required', $rules)) { |