Author: fabien
Date: 2010-01-19 11:43:09 +0100 (Tue, 19 Jan 2010)
New Revision: 26871

Modified:
   branches/1.3/lib/validator/sfValidatorDate.class.php
   branches/1.4/lib/validator/sfValidatorDate.class.php
Log:
[1.3, 1.4] fixed sfValidateDate for negative timestamps (closes #8134)

Modified: branches/1.3/lib/validator/sfValidatorDate.class.php
===================================================================
--- branches/1.3/lib/validator/sfValidatorDate.class.php        2010-01-19 
10:34:52 UTC (rev 26870)
+++ branches/1.3/lib/validator/sfValidatorDate.class.php        2010-01-19 
10:43:09 UTC (rev 26871)
@@ -82,7 +82,7 @@
     }
 
     // convert timestamp to date number format
-    if (ctype_digit($value))
+    if (is_numeric($value))
     {
       $cleanTime = (integer) $value;
       $clean     = date('YmdHis', $cleanTime);
@@ -106,7 +106,7 @@
     if ($max = $this->getOption('max'))
     {
       // convert timestamp to date number format
-      if (ctype_digit($max))
+      if (is_numeric($max))
       {
         $maxError = date($this->getOption('date_format_range_error'), $max);
         $max      = date('YmdHis', $max);
@@ -129,7 +129,7 @@
     if ($min = $this->getOption('min'))
     {
       // convert timestamp to date number
-      if (ctype_digit($min))
+      if (is_numeric($min))
       {
         $minError = date($this->getOption('date_format_range_error'), $min);
         $min      = date('YmdHis', $min);

Modified: branches/1.4/lib/validator/sfValidatorDate.class.php
===================================================================
--- branches/1.4/lib/validator/sfValidatorDate.class.php        2010-01-19 
10:34:52 UTC (rev 26870)
+++ branches/1.4/lib/validator/sfValidatorDate.class.php        2010-01-19 
10:43:09 UTC (rev 26871)
@@ -82,7 +82,7 @@
     }
 
     // convert timestamp to date number format
-    if (ctype_digit($value))
+    if (is_numeric($value))
     {
       $cleanTime = (integer) $value;
       $clean     = date('YmdHis', $cleanTime);
@@ -106,7 +106,7 @@
     if ($max = $this->getOption('max'))
     {
       // convert timestamp to date number format
-      if (ctype_digit($max))
+      if (is_numeric($max))
       {
         $maxError = date($this->getOption('date_format_range_error'), $max);
         $max      = date('YmdHis', $max);
@@ -129,7 +129,7 @@
     if ($min = $this->getOption('min'))
     {
       // convert timestamp to date number
-      if (ctype_digit($min))
+      if (is_numeric($min))
       {
         $minError = date($this->getOption('date_format_range_error'), $min);
         $min      = date('YmdHis', $min);

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.


Reply via email to