diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/standard/datetime.c | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -21,6 +21,8 @@ PHP NEWS - Fixed segfaults when CURL callback functions throw exception. (Tony) - Fixed various reentrancy bugs in user-sort functions, solves bugs #33286 and #33295. (Mike Bretz) +- Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9). + (Derick) - Fixed bug #34299 (ReflectionClass::isInstantiable() returns true for abstract classes). (Marcus) - Fixed bug #34078 (Reflection API problems in methods with boolean or diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 3ac1b7c476..b0a42ae5a8 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -657,7 +657,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; |