]> granicus.if.org Git - php/commitdiff
- Fixed bug #40290 (strtotime() returns unexpected result with particular
authorDerick Rethans <derick@php.net>
Fri, 13 Apr 2007 08:11:07 +0000 (08:11 +0000)
committerDerick Rethans <derick@php.net>
Fri, 13 Apr 2007 08:11:07 +0000 (08:11 +0000)
  timezone offset).

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

diff --git a/NEWS b/NEWS
index 6a44880d8350c0ae70125f13a20204a8353cdb81..a6d6501c4e7c849983192f22354d35b23a9e8ba3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP                                                                        NEWS
   (Ilia)
 - Fixed bug #40861 (strtotime() doesn't handle double negative relative time
   units correctly). (Derick)
+- Fixed bug #40290 (strtotime() returns unexpected result with particular
+  timezone offset). (Derick)
 
 
 10 Apr 2007, PHP 5.2.2RC1
index ef23ab1ca49beca2291c16b1919a5415c52df429..00fee9cf64e5e2b268037c363f51a9233c5b8c63 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.0 on Wed Apr 11 16:31:33 2007 */
+/* Generated by re2c 0.11.0 on Fri Apr 13 10:06:46 2007 */
 #line 1 "ext/date/lib/parse_date.re"
 /*
    +----------------------------------------------------------------------+
@@ -21774,7 +21774,8 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
                } else {
                        timelib_error_container_dtor(in.errors);
                }
-               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->z = in.time->dst = -1;
+               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->dst = -1;
+               in.time->z = -999999;
                in.time->is_localtime = in.time->zone_type = 0;
                return in.time;
        }
@@ -21793,7 +21794,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
        in.time->i = -1;
        in.time->s = -1;
        in.time->f = -1;
-       in.time->z = -1;
+       in.time->z = -999999;
        in.time->dst = -1;
        in.tzdb = tzdb;
        in.time->is_localtime = 0;
@@ -21830,7 +21831,7 @@ void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
        if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0;
        if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0;
        if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0;
-       if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0;
+       if (parsed->z == -999999) parsed->z = now->z != -999999 ? now->z : 0;
        if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0;
 
        if (!parsed->tz_abbr) {
index 1f6d7aeb6241f6e9f847566ea8e643c6b49b3f7c..20e72ef922da489f0f5258bb50b0c34b56534265 100644 (file)
@@ -1543,7 +1543,8 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
                } else {
                        timelib_error_container_dtor(in.errors);
                }
-               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->z = in.time->dst = -1;
+               in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->dst = -1;
+               in.time->z = -999999;
                in.time->is_localtime = in.time->zone_type = 0;
                return in.time;
        }
@@ -1562,7 +1563,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
        in.time->i = -1;
        in.time->s = -1;
        in.time->f = -1;
-       in.time->z = -1;
+       in.time->z = -999999;
        in.time->dst = -1;
        in.tzdb = tzdb;
        in.time->is_localtime = 0;
@@ -1599,7 +1600,7 @@ void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
        if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0;
        if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0;
        if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0;
-       if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0;
+       if (parsed->z == -999999) parsed->z = now->z != -999999 ? now->z : 0;
        if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0;
 
        if (!parsed->tz_abbr) {