From: Ilia Alshanetsky Date: Wed, 12 Nov 2003 02:58:38 +0000 (+0000) Subject: MFH: Fixed bug #26198 (strtotime() handling of M/F Y date format). X-Git-Tag: php-4.3.5RC1~214 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5fb634af417917f2cd56d4d17be071de54007bf;p=php MFH: Fixed bug #26198 (strtotime() handling of M/F Y date format). --- diff --git a/NEWS b/NEWS index c13ef048e1..8f933796b1 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP 4 NEWS ?? ??? 2003, Version 4.3.5 - Fixed header handler in NSAPI SAPI module (header->replace was ignored, send_default_content_type now sends value from php.ini). (Uwe Schindler) +- Fixed bug #26198 (strtotime() handling of M/F Y date format). (Ilia) - Fixed bug #26176 (Fixed handling of numeric keys in INI files). (Ilia) - Fixed bug #26168 (shtool availability check in phpize). (robbat2 at gentoo dot org, Ilia) diff --git a/ext/standard/parsedate.y b/ext/standard/parsedate.y index 6fe1fb1b13..d3dd96449c 100644 --- a/ext/standard/parsedate.y +++ b/ext/standard/parsedate.y @@ -308,7 +308,11 @@ date : tUNUMBER '/' tUNUMBER { } | tMONTH tUNUMBER { ((struct date_yy *)parm)->yyMonth = $1; - ((struct date_yy *)parm)->yyDay = $2; + if ($2 > 1000) { + ((struct date_yy *)parm)->yyYear = $2; + } else { + ((struct date_yy *)parm)->yyDay = $2; + } } | tMONTH tUNUMBER ',' tUNUMBER { ((struct date_yy *)parm)->yyMonth = $1; @@ -317,7 +321,11 @@ date : tUNUMBER '/' tUNUMBER { } | tUNUMBER tMONTH { ((struct date_yy *)parm)->yyMonth = $2; - ((struct date_yy *)parm)->yyDay = $1; + if ($1 > 1000) { + ((struct date_yy *)parm)->yyYear = $1; + } else { + ((struct date_yy *)parm)->yyDay = $1; + } } | tUNUMBER tMONTH tUNUMBER { ((struct date_yy *)parm)->yyMonth = $2;