From: Derick Rethans Date: Tue, 30 Aug 2005 09:14:51 +0000 (+0000) Subject: - Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9). X-Git-Tag: php-4.4.1RC1~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=214949457cfcec3343def0de39a714b51647fffd;p=php - Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9). --- diff --git a/NEWS b/NEWS index 94d86a0f15..711381bfdd 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2005, Version 4.4.1 +- Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9). + (Derick) - Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). (Ilia) - Fixed bug #34156 (memory usage remains elevated after memory limit is reached). (Ilia) diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index a8359024f4..7255b6d746 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -626,7 +626,7 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int gm) wk = (yd + 6 - wd + fd) / 7 - (fd > 3); } - sprintf(tmp_buff, "%d", wk); /* SAFE */ + sprintf(tmp_buff, "%02d", wk); /* SAFE */ strcat(Z_STRVAL_P(return_value), tmp_buff); break;