summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-08-08 16:49:30 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-08-08 16:49:30 +0000
commit919b0bd5b44cc2e1572370616592c43d3403e3b7 (patch)
treec311e81df676dfd2657e8411cbe1b391e3d741b7
parentee5fd96e37a1396e87f8bcfd55ef22a5043a0794 (diff)
downloadphp-git-919b0bd5b44cc2e1572370616592c43d3403e3b7.tar.gz
Adjust date("") handling.
-rw-r--r--ext/date/php_date.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index b033f6f904..ea105b0fc5 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -347,6 +347,10 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
timelib_time_offset *offset;
timelib_sll isoweek, isoyear;
+ if (!format_len) {
+ return estrdup("");
+ }
+
if (localtime) {
if (t->zone_type == TIMELIB_ZONETYPE_ABBR) {
offset = timelib_time_offset_ctor();
@@ -369,7 +373,6 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
}
}
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++) {