summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2014-08-18 18:31:26 +0100
committerDerick Rethans <github@derickrethans.nl>2014-08-18 18:41:50 +0100
commit36d05d75c8d4db6d540dd7ac7cf80a4031f6ca40 (patch)
tree31fd00104b70a19607102cb5f49b3d0532027bd8
parent2b9af967fbf12d9eb5fd74a7d6d31431307b0870 (diff)
downloadphp-git-36d05d75c8d4db6d540dd7ac7cf80a4031f6ca40.tar.gz
Fixed bug #67109: First uppercase letter breaks date string parsing.
-rw-r--r--ext/date/lib/parse_date.c4
-rw-r--r--ext/date/lib/parse_date.re2
-rw-r--r--ext/date/tests/bug67109.phpt12
3 files changed, 15 insertions, 3 deletions
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index ecfdbefff3..fbc76402ab 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sun Aug 17 11:08:33 2014 */
+/* Generated by re2c 0.13.5 on Mon Aug 18 18:28:27 2014 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -19863,7 +19863,7 @@ yy1315:
TIMELIB_HAVE_RELATIVE();
/* skip "last day of" or "first day of" */
- if (*ptr == 'l') {
+ if (*ptr == 'l' || *ptr == 'L') {
s->time->relative.first_last_day_of = 2;
} else {
s->time->relative.first_last_day_of = 1;
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index 4cbbb554bf..c7953e75ba 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -1029,7 +1029,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
TIMELIB_HAVE_RELATIVE();
/* skip "last day of" or "first day of" */
- if (*ptr == 'l') {
+ if (*ptr == 'l' || *ptr == 'L') {
s->time->relative.first_last_day_of = 2;
} else {
s->time->relative.first_last_day_of = 1;
diff --git a/ext/date/tests/bug67109.phpt b/ext/date/tests/bug67109.phpt
new file mode 100644
index 0000000000..bcdacb038c
--- /dev/null
+++ b/ext/date/tests/bug67109.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #67109 (First uppercase letter breaks date string parsing)
+--FILE--
+<?php
+var_dump(date('d.m.Y',strtotime('last day of this month')));
+var_dump(date('d.m.Y',strtotime('Last day of this month')));
+var_dump(date('d.m.Y',strtotime('lAst Day of This Month')));
+?>
+--EXPECT--
+string(10) "31.08.2014"
+string(10) "31.08.2014"
+string(10) "31.08.2014"