iliaa Fri Dec 16 22:36:49 2005 EDT
Added files: (Branch: PHP_5_1)
/php-src/ext/date/tests bug35705.phpt
Modified files:
/php-src NEWS
/php-src/ext/date/lib parse_date.c parse_date.re
Log:
Fixed bug #35705 (strtotime() fails to parse soap date format without TZ).
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.296&r2=1.2027.2.297&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.296 php-src/NEWS:1.2027.2.297
--- php-src/NEWS:1.2027.2.296 Fri Dec 16 20:09:16 2005
+++ php-src/NEWS Fri Dec 16 22:36:41 2005
@@ -28,6 +28,8 @@
connecting to 5.x server. (Andrey)
- Fixed bug #35713 (getopt() returns array with numeric strings when passed
options like '-1'). (Tony)
+- Fixed bug #35705 (strtotime() fails to parse soap date format without TZ).
+ (Ilia)
- Fixed bug #35694 (Improved error message for invalid fetch mode). (Ilia)
- Fixed bug #35692 (iconv_mime_decode() segmentation fault; with libiconv
only). (Tony)
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_date.c?r1=1.29.2.18&r2=1.29.2.19&diff_format=u
Index: php-src/ext/date/lib/parse_date.c
diff -u php-src/ext/date/lib/parse_date.c:1.29.2.18
php-src/ext/date/lib/parse_date.c:1.29.2.19
--- php-src/ext/date/lib/parse_date.c:1.29.2.18 Tue Dec 13 02:28:34 2005
+++ php-src/ext/date/lib/parse_date.c Fri Dec 16 22:36:41 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.11.rc1 on Mon Dec 12 21:23:34 2005 */
+/* Generated by re2c 0.9.11.rc1 on Fri Dec 16 17:30:27 2005 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_date.c,v 1.29.2.18 2005/12/13 02:28:34 iliaa Exp $ */
+/* $Id: parse_date.c,v 1.29.2.19 2005/12/16 22:36:41 iliaa Exp $ */
#include "timelib.h"
@@ -850,7 +850,7 @@
yy3:
YYDEBUG(3, *YYCURSOR);
-#line 1321 "ext/date/lib/parse_date.re"
+#line 1323 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -978,7 +978,7 @@
yy8:
YYDEBUG(8, *YYCURSOR);
-#line 1387 "ext/date/lib/parse_date.re"
+#line 1389 "ext/date/lib/parse_date.re"
{
/* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */
s->errors++;
@@ -2023,7 +2023,7 @@
yy45:
YYDEBUG(45, *YYCURSOR);
-#line 1376 "ext/date/lib/parse_date.re"
+#line 1378 "ext/date/lib/parse_date.re"
{
goto std;
}
@@ -2039,7 +2039,7 @@
yy48:
YYDEBUG(48, *YYCURSOR);
-#line 1381 "ext/date/lib/parse_date.re"
+#line 1383 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
@@ -2252,7 +2252,7 @@
yy68:
YYDEBUG(68, *YYCURSOR);
-#line 1360 "ext/date/lib/parse_date.re"
+#line 1362 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -3244,7 +3244,7 @@
yy173:
YYDEBUG(173, *YYCURSOR);
-#line 1304 "ext/date/lib/parse_date.re"
+#line 1306 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior;
@@ -5022,7 +5022,7 @@
yy342:
YYDEBUG(342, *YYCURSOR);
-#line 1288 "ext/date/lib/parse_date.re"
+#line 1290 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -6306,7 +6306,7 @@
yy432:
YYDEBUG(432, *YYCURSOR);
-#line 1332 "ext/date/lib/parse_date.re"
+#line 1334 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong |
dateshortwithtimelongtz");
@@ -7164,7 +7164,7 @@
yy495:
YYDEBUG(495, *YYCURSOR);
-#line 1219 "ext/date/lib/parse_date.re"
+#line 1221 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextshort");
TIMELIB_INIT;
@@ -9028,7 +9028,7 @@
yy597:
YYDEBUG(597, *YYCURSOR);
-#line 1273 "ext/date/lib/parse_date.re"
+#line 1275 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -13432,7 +13432,7 @@
yy903:
YYDEBUG(903, *YYCURSOR);
-#line 1245 "ext/date/lib/parse_date.re"
+#line 1247 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -13850,7 +13850,7 @@
yy956:
YYDEBUG(956, *YYCURSOR);
-#line 1232 "ext/date/lib/parse_date.re"
+#line 1234 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextreverse");
TIMELIB_INIT;
@@ -13995,7 +13995,7 @@
yy968:
YYDEBUG(968, *YYCURSOR);
-#line 1264 "ext/date/lib/parse_date.re"
+#line 1266 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -14360,7 +14360,7 @@
yy997:
YYDEBUG(997, *YYCURSOR);
-#line 1200 "ext/date/lib/parse_date.re"
+#line 1202 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -14386,7 +14386,7 @@
yy999:
YYDEBUG(999, *YYCURSOR);
-#line 1181 "ext/date/lib/parse_date.re"
+#line 1183 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -14473,7 +14473,7 @@
yy1003:
YYDEBUG(1003, *YYCURSOR);
-#line 1168 "ext/date/lib/parse_date.re"
+#line 1170 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgydotd");
TIMELIB_INIT;
@@ -14715,13 +14715,15 @@
s->time->s = timelib_get_nr((char **) &ptr, 2);
if (*ptr == '.') {
s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
- s->time->z = timelib_get_zone((char **) &ptr,
&s->time->dst, s->time, &tz_not_found, s->tzdb);
- s->errors += tz_not_found;
+ if (*ptr) { /* timezone is optional */
+ s->time->z = timelib_get_zone((char **) &ptr,
&s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
}
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
-#line 12653 "ext/date/lib/parse_date.c"
+#line 12655 "ext/date/lib/parse_date.c"
yy1022:
YYDEBUG(1022, *YYCURSOR);
yych = *++YYCURSOR;
@@ -15356,7 +15358,7 @@
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 13106 "ext/date/lib/parse_date.c"
+#line 13108 "ext/date/lib/parse_date.c"
yy1113:
YYDEBUG(1113, *YYCURSOR);
yyaccept = 19;
@@ -15895,20 +15897,21 @@
goto yy1161;
yy1161:
YYDEBUG(1161, *YYCURSOR);
- ++YYCURSOR;
+ yyaccept = 20;
+ YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
yych = *YYCURSOR;
goto yy1162;
yy1162:
YYDEBUG(1162, *YYCURSOR);
if(yych <= ','){
- if(yych != '+') goto yy52;
+ if(yych != '+') goto yy1021;
goto yy1163;
} else {
if(yych <= '-') goto yy1163;
- if(yych <= '/') goto yy52;
+ if(yych <= '/') goto yy1021;
if(yych <= '9') goto yy1161;
- goto yy52;
+ goto yy1021;
}
yy1163:
YYDEBUG(1163, *YYCURSOR);
@@ -16469,7 +16472,7 @@
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
-#line 14031 "ext/date/lib/parse_date.c"
+#line 14034 "ext/date/lib/parse_date.c"
yy1206:
YYDEBUG(1206, *YYCURSOR);
yych = *++YYCURSOR;
@@ -16583,7 +16586,7 @@
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
-#line 14129 "ext/date/lib/parse_date.c"
+#line 14132 "ext/date/lib/parse_date.c"
yy1214:
YYDEBUG(1214, *YYCURSOR);
yyaccept = 22;
@@ -16961,7 +16964,7 @@
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 14451 "ext/date/lib/parse_date.c"
+#line 14454 "ext/date/lib/parse_date.c"
yy1239:
YYDEBUG(1239, *YYCURSOR);
yych = *++YYCURSOR;
@@ -17054,7 +17057,7 @@
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 14526 "ext/date/lib/parse_date.c"
+#line 14529 "ext/date/lib/parse_date.c"
yy1248:
YYDEBUG(1248, *YYCURSOR);
yych = *++YYCURSOR;
@@ -17077,7 +17080,7 @@
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 14543 "ext/date/lib/parse_date.c"
+#line 14546 "ext/date/lib/parse_date.c"
yy1251:
YYDEBUG(1251, *YYCURSOR);
yych = *++YYCURSOR;
@@ -17180,7 +17183,7 @@
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 14628 "ext/date/lib/parse_date.c"
+#line 14631 "ext/date/lib/parse_date.c"
yy1260:
YYDEBUG(1260, *YYCURSOR);
yych = *++YYCURSOR;
@@ -17217,7 +17220,7 @@
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 14659 "ext/date/lib/parse_date.c"
+#line 14662 "ext/date/lib/parse_date.c"
yy1263:
YYDEBUG(1263, *YYCURSOR);
yych = *++YYCURSOR;
@@ -17297,10 +17300,10 @@
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 14721 "ext/date/lib/parse_date.c"
+#line 14724 "ext/date/lib/parse_date.c"
}
}
-#line 1392 "ext/date/lib/parse_date.re"
+#line 1394 "ext/date/lib/parse_date.re"
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_date.re?r1=1.26.2.15&r2=1.26.2.16&diff_format=u
Index: php-src/ext/date/lib/parse_date.re
diff -u php-src/ext/date/lib/parse_date.re:1.26.2.15
php-src/ext/date/lib/parse_date.re:1.26.2.16
--- php-src/ext/date/lib/parse_date.re:1.26.2.15 Tue Dec 13 02:28:37 2005
+++ php-src/ext/date/lib/parse_date.re Fri Dec 16 22:36:46 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_date.re,v 1.26.2.15 2005/12/13 02:28:37 iliaa Exp $ */
+/* $Id: parse_date.re,v 1.26.2.16 2005/12/16 22:36:46 iliaa Exp $ */
#include "timelib.h"
@@ -794,7 +794,7 @@
datenocolon = year4 monthlz daylz;
/* Special formats */
-soap = year4 "-" monthlz "-" daylz "T" hour24lz ":" minutelz ":"
secondlz frac tzcorrection;
+soap = year4 "-" monthlz "-" daylz "T" hour24lz ":" minutelz ":"
secondlz frac tzcorrection?;
xmlrpc = year4 monthlz daylz "T" hour24 ":" minutelz ":" secondlz;
xmlrpcnocolon = year4 monthlz daylz 't' hour24 minutelz secondlz;
wddx = year4 "-" monthlz "-" daylz "T" hour24 ":" minutelz ":"
secondlz;
@@ -1157,8 +1157,10 @@
s->time->s = timelib_get_nr((char **) &ptr, 2);
if (*ptr == '.') {
s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
- s->time->z = timelib_get_zone((char **) &ptr,
&s->time->dst, s->time, &tz_not_found, s->tzdb);
- s->errors += tz_not_found;
+ if (*ptr) { /* timezone is optional */
+ s->time->z = timelib_get_zone((char **) &ptr,
&s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
}
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/tests/bug35705.phpt?view=markup&rev=1.1
Index: php-src/ext/date/tests/bug35705.phpt
+++ php-src/ext/date/tests/bug35705.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php