[Solar-svn] Revision 3052
pmjones at solarphp.com
pmjones at solarphp.com
Wed Mar 26 15:29:42 CDT 2008
Solar_Filter_ValidateCompare: [FIX] Previously (incorrectly) would skip validation if the value was null. Now does the comparison regardless of nullity.
Modified: trunk/Solar/Filter/ValidateCompare.php
===================================================================
--- trunk/Solar/Filter/ValidateCompare.php 2008-03-26 19:18:13 UTC (rev 3051)
+++ trunk/Solar/Filter/ValidateCompare.php 2008-03-26 20:29:42 UTC (rev 3052)
@@ -33,23 +33,16 @@
* Validates that this value is the same as some other value in the
* data filter chain.
*
- * When this value is exactly null, the comparison is not performed.
- * Empty string, numeric zero, and boolean false will all enable the
- * comparison check.
- *
* Useful for checking that the user entered the same password twice, or
* the same email twice, etc.
*
* Be sure to use this only as part of a filter chain, as it will attempt
* to look up the other value in the filter data.
*
+ * E.g., `validateCompare('email_confirm', 'email')`.
*
- * E.g., `validateCompare('email_confirm', 'email')`. This means that
- * when `email_confirm` is exactly null, it will validate.
+ * @param mixed $value The value to validate.
*
- * @param mixed $value The value to validate. If exactly null, the
- * validation will automatically pass.
- *
* @param string $compare_key Check against the value of this element in
* $this->_data.
*
@@ -61,12 +54,8 @@
*/
public function validateCompare($value, $compare_key, $strict = false)
{
- if ($value === null) {
- return true;
- }
-
$compare_val = $this->_filter->getData($compare_key);
-
+
if ($strict) {
return $value === $compare_val;
} else {
More information about the Solar-svn
mailing list