From a475b2c1db3512eabfece71430cb49065f558e40 Mon Sep 17 00:00:00 2001 From: Boro Sitnikovski Date: Fri, 13 Sep 2013 02:20:19 +0200 Subject: [PATCH] Bug 64157 Changed error message to make sense --- ext/date/lib/parse_date.c | 2 +- ext/date/lib/parse_date.re | 2 +- ext/date/tests/bug64157.phpt | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 ext/date/tests/bug64157.phpt diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 2ad4d31edb..f510a665e8 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -25036,7 +25036,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim TIMELIB_CHECK_NUMBER; sec = timelib_get_nr_ex((char **) &ptr, 2, &length); if (sec == TIMELIB_UNSET || length != 2) { - add_pbf_error(s, "A two second minute could not be found", string, begin); + add_pbf_error(s, "A two digit second could not be found", string, begin); } else { s->time->s = sec; } diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index f874682ce6..df33508f50 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -2043,7 +2043,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim TIMELIB_CHECK_NUMBER; sec = timelib_get_nr_ex((char **) &ptr, 2, &length); if (sec == TIMELIB_UNSET || length != 2) { - add_pbf_error(s, "A two second minute could not be found", string, begin); + add_pbf_error(s, "A two digit second could not be found", string, begin); } else { s->time->s = sec; } diff --git a/ext/date/tests/bug64157.phpt b/ext/date/tests/bug64157.phpt new file mode 100644 index 0000000000..fb71495430 --- /dev/null +++ b/ext/date/tests/bug64157.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test for bug #64157: DateTime::createFromFormat() reports confusing error message +--CREDITS-- +Boro Sitnikovski +--INI-- +date.timezone = UTC +--FILE-- + +--EXPECT-- +A two digit second could not be found -- 2.40.0