diff options
author | David Croft <david@php.net> | 2001-01-10 04:01:02 +0000 |
---|---|---|
committer | David Croft <david@php.net> | 2001-01-10 04:01:02 +0000 |
commit | 0afe88cbc6818f9d00e96294149270d0c55547a0 (patch) | |
tree | c730a87e48aca841589d516800c9ef412752886e /ext/standard | |
parent | b161bc159359e4d6187faa0bd38a1ed307626d09 (diff) | |
download | php-git-0afe88cbc6818f9d00e96294149270d0c55547a0.tar.gz |
Allocate buffer in date() for the actual length of the timezone (bug#8292)
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/datetime.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 15c417ee24..159804d034 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -255,9 +255,15 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm) break; case 'F': /* month, textual, full */ case 'l': /* day (of the week), textual */ - case 'T': /* timezone name */ size += 28; break; + case 'T': /* timezone name */ +#if HAVE_TM_ZONE + size += strlen(ta->tm_zone); +#else + size += strlen(tzname[0]); +#endif + break; case 'Z': /* timezone offset in seconds */ size += 6; break; |