From 02ac187ce4789c5ab122a41e3b064ca923d98a82 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 16 Mar 2016 12:19:34 +0200 Subject: Fix a Form_validation bug that unnecessarily modifes $_POST --- system/libraries/Form_validation.php | 2 +- user_guide_src/source/changelog.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 ` always accepted empty array inputs. - Fixed a bug where :doc:`Session Library ` allowed accessing ``$_SESSION`` values as class properties but ``isset()`` didn't work on them. +- Fixed a bug where :doc:`Form Validation Library ` modified the ``$_POST`` array when the data being validated was actually provided via ``set_data()``. Version 3.0.5 ============= -- cgit v1.2.3-24-g4f1b