summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php16
1 files changed, 9 insertions, 7 deletions
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);
}
// --------------------------------------------------------------------