From eb64b777faa566ee00b40ac540f47ebde6ba9968 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 2 May 2008 21:33:05 +0000 Subject: [PATCH] - MFH: Fixed an issue in date() where a : was printed for the O modifier after a P modifier was used. --- NEWS | 2 ++ ext/date/php_date.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3c3b960bcc..608379b5f0 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 5652e7adec..639b391de7 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; -- 2.50.1