summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorDavid Woods <d.woods92@gmail.com>2015-03-17 18:55:10 +0100
committerDavid Woods <d.woods92@gmail.com>2015-03-17 18:55:10 +0100
commit8384dd9de4c2721113a5d3158ed06b3cc5bfc145 (patch)
tree3d182543de021cf95197f7836d661ead2f1c35b1 /system/libraries
parentc7029e2e5f479a541d951d6f6ebf1b33a82a1632 (diff)
Removed bug fixes from this branch. Will recommit them on a separate branch
Signed-off-by: David Woods <d.woods92@gmail.com>
Diffstat (limited to 'system/libraries')
-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);
}
// --------------------------------------------------------------------