diff options
author | Derick Rethans <derick@php.net> | 2005-07-04 07:48:19 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2005-07-04 07:48:19 +0000 |
commit | 346c09092462688ca9a3d00062d47e784cfcb391 (patch) | |
tree | c5cf37749769e95cb4556bbcb452c0b31d1761ed | |
parent | effc5f1927b50fc279b004d26c55acf850843331 (diff) | |
download | php-git-346c09092462688ca9a3d00062d47e784cfcb391.tar.gz |
- Fixed bug #33562 (date("") crashes).
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/date/php_date.c | 1 | ||||
-rw-r--r-- | ext/date/tests/bug33562.phpt | 11 |
3 files changed, 13 insertions, 0 deletions
@@ -6,6 +6,7 @@ PHP NEWS - Added date_timezone_set() function to set the timezone that the date functions will use. (Derick) - Implemented feature request #33452 (Year belonging to ISO week). (Derick) +- Fixed bug #33562 (date("") crashes). (Derick) - Fixed bug #33536 (strtotime() defaults to now even on non time string). (Derick) - Fixed bug #33532 (Different output for strftime() and date()). (Derick) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index b5a1b66ccf..eaa7f9c742 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -228,6 +228,7 @@ static char *php_format_date(char *format, int format_len, timelib_time *t, int offset = timelib_get_time_zone_info(t->sse, t->tz_info); } buffer[32] = '\0'; + smart_str_appends(&string, ""); timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); for (i = 0; i < format_len; i++) { diff --git a/ext/date/tests/bug33562.phpt b/ext/date/tests/bug33562.phpt new file mode 100644 index 0000000000..f86fce6d62 --- /dev/null +++ b/ext/date/tests/bug33562.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #33562 (date("") crashes) +--FILE-- +<?php +date_timezone_set("GMT"); +echo "[", date(""), "]\n"; +echo "done"; +?> +--EXPECT-- +[] +done |