Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-14-2008, 08:52 AM
Junior Member
 
Join Date: Sep 2008
Posts: 8
Post Zend_Validate_Date working in unexpected ways.

Just started using Zend_Validate_Date for date validation, and
ran into some weird issues. Seems like the validator returns false positive
for even obvious non-valid data.

Code:
$dateValidator = new Zend_Validate_Date();
$dateValidator->setFormat('yyyy-MM-dd HH:mm:ss');

$date = '0a-09-11 08:46:00';

if($dateValidator->isValid($date)) {
   echo $date . " is a valid date.(!?)\n";
   die();
}
Obviously this date is not of the required format, but the validator still accepts it as true.

Zend_Date::__construct also casually ignores the broken date part and just uses the correct time part. This might be intentional, while the validator definitely should not return true for a broken date string.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:49 PM.