diff --git a/NEWS b/NEWS index 3c3b960bccc..608379b5f05 100644 --- a/NEWS +++ b/NEWS @@ -160,6 +160,8 @@ PHP NEWS to different characters with cp1251 and cp866. (Scott) - Fixed possible crash in ext/soap because of uninitialized value. (Zdash Urf) - Fixed PECL bug #12431 (OCI8 ping functionality is broken). (Oracle Corp.) +- Fixed an issue in date() where a : was printed for the O modifier after a P + modifier was used. (Derick) - Fixed bug #44805 (rename() function is not portable to Windows). (Pierre) - Fixed bug #44742 (timezone_offset_get() causes segmentation faults). (Derick) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 5652e7adec6..639b391de72 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -805,7 +805,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca char buffer[33]; timelib_time_offset *offset = NULL; timelib_sll isoweek, isoyear; - int rfc_colon = 0; + int rfc_colon; if (!format_len) { return estrdup(""); @@ -835,6 +835,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); for (i = 0; i < format_len; i++) { + rfc_colon = 0; switch (format[i]) { /* day */ case 'd': length = slprintf(buffer, 32, "%02d", (int) t->d); break;