Issues

ZF-8654: Zend_Validate_Date reports date as valid, when validating incorrect date without separators

Description

When trying to validate user entered date, which has no separators, Zend_Validate_Date reports it as 'Valid', though it's not really a valid one.

Example:


$objValidator = new Zend_Validate_Date();
echo $objValidator->setFormat('MM-dd-YYYY')->isValid(123) ? 'Valid' : 'Invalid';
echo $objValidator->setFormat('MM-dd-YYYY')->isValid('123123') ? 'Valid' : 'Invalid';
echo $objValidator->setFormat('MM-dd-YYYY')->isValid('12232008') ? 'Valid' : 'Invalid';

Expected: Invalid Invalid Invalid Result: Valid Valid Valid

It seems that Zend_Locale_Format::_parseDate() tries to parse date even if format given doesn't have any separators.

Comments

Duplicates ZF-7583