laravel/framework — pull request #6329 by mattwells (2014-11-05 14:56:04+00:00)
Title: Date Validation with big (invalid?) dates

PHP has some difficult handling dates with a year over 9999 for example if you pass a date like "11972-04-01" into DateTime it will return "2004-08-13" which is clearly not correct. However, the date validator considers this date to be valid.

My specific problem comes from pushing that date (which has been validated) into a model which uses the method Carbon::createFromFormat('Y-m-d H:i:s', '11972-04-01') which will throw an InvalidArgumentException.

The problem with the validateDate is that it is making use of the PHP function date_parse() which is changing the years 11972 to 2002 and 22014 to 2014 which is then being pumped into checkdate() which will validate because date_parse() has "corrected" it.

This is loosely related to issue #329 validateDate could be better.