summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-03-16 11:19:34 +0100
committerAndrey Andreev <narf@devilix.net>2016-03-16 11:19:34 +0100
commit02ac187ce4789c5ab122a41e3b064ca923d98a82 (patch)
tree8f1a17ec42906e17d18129fd22300e66c90f3d7b
parent5576d2ca40666ada969fb2cb951fbddf8ca4ad8e (diff)
Fix a Form_validation bug that unnecessarily modifes $_POST
-rw-r--r--system/libraries/Form_validation.php2
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 2 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index ed4b9bccb..e4a518957 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -486,7 +486,7 @@ class CI_Form_validation {
}
// Now we need to re-set the POST data with the new, processed data
- $this->_reset_post_array();
+ empty($this->validation_data) && $this->_reset_post_array();
return ($total_errors === 0);
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index e235d2e6a..8203aba41 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -17,6 +17,7 @@ Bug fixes for 3.0.6
- Fixed a bug (#4516) - :doc:`Form Validation Library <libraries/form_validation>` always accepted empty array inputs.
- Fixed a bug where :doc:`Session Library <libraries/sessions>` allowed accessing ``$_SESSION`` values as class properties but ``isset()`` didn't work on them.
+- Fixed a bug where :doc:`Form Validation Library <libraries/form_validation>` modified the ``$_POST`` array when the data being validated was actually provided via ``set_data()``.
Version 3.0.5
=============