From 8384dd9de4c2721113a5d3158ed06b3cc5bfc145 Mon Sep 17 00:00:00 2001 From: David Woods Date: Tue, 17 Mar 2015 10:55:10 -0700 Subject: Removed bug fixes from this branch. Will recommit them on a separate branch Signed-off-by: David Woods --- system/libraries/Form_validation.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 32ea4b1b4..05de59628 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1091,12 +1091,14 @@ class CI_Form_validation { * Match one field to another * * @param string $str string to compare against - * @param string $param The string desired + * @param string $field * @return bool */ - public function matches($str, $param) + public function matches($str, $field) { - return ($str === $param); + return isset($this->_field_data[$field], $this->_field_data[$field]['postdata']) + ? ($str === $this->_field_data[$field]['postdata']) + : FALSE; } // -------------------------------------------------------------------- @@ -1105,12 +1107,12 @@ class CI_Form_validation { * Differs from another field * * @param string - * @param string param is the value provided in the form + * @param string field * @return bool */ - public function differs($str, $param) + public function differs($str, $field) { - return ($str !== $param); + return ! (isset($this->_field_data[$field]) && $this->_field_data[$field]['postdata'] === $str); } // -------------------------------------------------------------------- @@ -1491,7 +1493,7 @@ class CI_Form_validation { */ public function valid_base64($str) { - return (base64_decode($str, true) !== false); + return (base64_encode(base64_decode($str)) === $str); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b