]> granicus.if.org Git - php/commitdiff
Backported the fix for bug #51393 (DateTime::createFromFormat() fails if format
authorAdam Harvey <aharvey@php.net>
Fri, 26 Mar 2010 10:12:43 +0000 (10:12 +0000)
committerAdam Harvey <aharvey@php.net>
Fri, 26 Mar 2010 10:12:43 +0000 (10:12 +0000)
string contains timezone) to PHP_5_2 per discussion with Derick.

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

diff --git a/NEWS b/NEWS
index fbcad3ff05aa02d26d51a092032d1c5318dd3585..3ed5dcf6938bfe312adc429980b68cde3ccb8b8b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ PHP                                                                        NEWS
 - Fixed a NULL pointer dereference when processing invalid XML-RPC
   requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
 
+- Fixed bug #51393 (DateTime::createFromFormat() fails if format string contains
+  timezone). (Adam)
 - Fixed bug #51338 (URL-Rewriter is still enabled if use_only_cookies is
   on). (Ilia, j dot jeising at gmail dot com)
 - Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam)
index b6958208d006067bbb2a6583620cbf1d63e8f849..0ebd6efa066a2644b020b24a331b3a99dbb2f13b 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sun Mar  7 18:35:25 2010 */
+/* Generated by re2c 0.13.5 on Fri Mar 26 18:06:18 2010 */
 #line 1 "ext/date/lib/parse_date.re"
 /*
    +----------------------------------------------------------------------+
@@ -469,7 +469,7 @@ static long timelib_parse_tz_cor(char **ptr)
        char *begin = *ptr, *end;
        long  tmp;
 
-       while (**ptr != '\0') {
+       while (isdigit(**ptr) || **ptr == ':') {
                ++*ptr;
        }
        end = *ptr;
index 53d1adb6765e02b46bc17c2659d6f1193597d3a6..059d73521a07aa6dbfe58280b7c7029b727b8244 100644 (file)
@@ -467,7 +467,7 @@ static long timelib_parse_tz_cor(char **ptr)
        char *begin = *ptr, *end;
        long  tmp;
 
-       while (**ptr != '\0') {
+       while (isdigit(**ptr) || **ptr == ':') {
                ++*ptr;
        }
        end = *ptr;