From cd9797a210089ea65b4d4b16db051d06188b66ed Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 28 Jun 2013 14:03:48 +0300 Subject: Fix #2498 --- 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 1ed50844c..40ba01202 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1405,7 +1405,7 @@ class CI_Form_validation { */ public function valid_base64($str) { - return ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str); + return (base64_encode(base64_decode($str)) === $str); } // -------------------------------------------------------------------- diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index c0f1566ed..0149d9f66 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -499,6 +499,7 @@ Bug fixes for 3.0 - Fixed a bug (#77) - :doc:`Database Class ` didn't properly handle the transaction "test mode" flag. - Fixed a bug (#2380) - :doc:`URI Routing ` method ``fetch_method()`` returned 'index' if the requested method name matches its controller name. - Fixed a bug (#2388) - :doc:`Email Library ` used to ignore attachment errors, resulting in broken emails being sent. +- Fixed a bug (#2498) - :doc:`Form Validation Library ` rule **valid_base64** only checked characters instead of actual validity. Version 2.1.3 ============= -- cgit v1.2.3-24-g4f1b