]> granicus.if.org Git - php/commitdiff
- MFH: Fixed bug #36638 (strtotime() returns false when 2nd argument < 1).
authorDerick Rethans <derick@php.net>
Mon, 6 Mar 2006 21:44:58 +0000 (21:44 +0000)
committerDerick Rethans <derick@php.net>
Mon, 6 Mar 2006 21:44:58 +0000 (21:44 +0000)
  (Derick)

NEWS
ext/date/lib/parse_date.c
ext/date/lib/parse_date.re
ext/date/php_date.c

diff --git a/NEWS b/NEWS
index 5da6aff0e8282b8fc05706259d3c146a6aedb434..fdf3b827000cc745e2bb8aca4cf84d117aaed976 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,7 @@ PHP                                                                        NEWS
 - Fixed tiger hash algorithm generating wrong results on big endian platforms.
   (Mike)
 - Fixed crash with DOMImplementation::createDocumentType("name:"). (Mike)
+- Fixed bug #36638 (strtotime() returns false when 2nd argument < 1). (Derick)
 - Fixed bug #36611 (assignment to SimpleXML object attribute changes argument 
   type to string). (Tony)
 - Fixed bug #36606 (pg_query_params() changes arguments type to string). (Tony)
index 3b326100783729c88121cbad6ed083ed9fa4771e..4c90f5f459a8b48bf59b752adf1f2b0258826d24 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.12 on Mon Feb 27 20:39:38 2006 */
+/* Generated by re2c 0.9.12 on Mon Mar  6 22:37:54 2006 */
 #line 1 "ext/date/lib/parse_date.re"
 /*
    +----------------------------------------------------------------------+
@@ -1139,7 +1139,7 @@ yy11:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        if(yych == '-') goto yy1185;
-       if(yych <= '0') goto yy12;
+       if(yych <= '/') goto yy12;
        if(yych <= '9') goto yy1186;
        goto yy12;
 yy12:
@@ -16619,7 +16619,7 @@ yy1184:
 yy1185:
        YYDEBUG(1185, *YYCURSOR);
        yych = *++YYCURSOR;
-       if(yych <= '0') goto yy53;
+       if(yych <= '/') goto yy53;
        if(yych >= ':') goto yy53;
        goto yy1186;
 yy1186:
index c763204b79803cb910e594d78f062fb661fccd61..7d65c76bb0c4af3eb021f36c8d935d4de2757917 100644 (file)
@@ -825,7 +825,7 @@ exif             = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" sec
 clf              = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
 
 /* Timestamp format: @1126396800 */
-timestamp        = "@" "-"? [1-9] [0-9]*;
+timestamp        = "@" "-"? [0-9]+;
 
 /* To fix some ambiguities */
 dateshortwithtimeshort  = datenoyear timeshort24;
index eb94dbe8ca2e26a83d825c1bdd38d0cc00e3e79a..758c0191063e8a1a0cbf440c9fb53e986d4d48ab 100644 (file)
@@ -826,7 +826,7 @@ PHP_FUNCTION(strtotime)
                now = timelib_time_ctor();
 
                initial_ts = emalloc(25);
-               snprintf(initial_ts, 24, "@%lu", preset_ts);
+               snprintf(initial_ts, 24, "@%ld", preset_ts);
                t = timelib_strtotime(initial_ts, strlen(initial_ts), &error1, DATE_TIMEZONEDB); /* we ignore the error here, as this should never fail */
                timelib_update_ts(t, tzi);
                now->tz_info = tzi;