diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 4829da6c9155..253c482aebd4 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -651,7 +651,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr) char *begin = *ptr, *end; const timelib_relunit *tp, *value = NULL; - while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') { + while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' && + **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) { ++*ptr; } end = *ptr; diff --git a/ext/date/tests/DateTime_fix_createFromFormat.phpt b/ext/date/tests/DateTime_fix_createFromFormat.phpt new file mode 100644 index 000000000000..b85a8e6784ce --- /dev/null +++ b/ext/date/tests/DateTime_fix_createFromFormat.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test fix for DateTime when date have textual day with dot or other special char at end +--FILE-- +format("D., M. j, Y g:iA") . "\n"; +echo "createFromFormat method: " . $fromFormat->format("D., M. j, Y g:iA") . "\n"; + +?> +===DONE=== +--EXPECTF-- +*** Testing clone on DateTime objects *** +Format method: Thu., Nov. 29, 2012 5:00PM +createFromFormat method: Thu., Nov. 29, 2012 5:00PM +===DONE===