From c2f5e792e2910d8c1ae3ca716e2e330a80c526ec Mon Sep 17 00:00:00 2001 From: lazerg Date: Thu, 15 Oct 2026 20:19:34 +0500 Subject: [PATCH] Fix GH-24350: Stale external tz database read after module restart --- NEWS | 4 ++++ ext/date/php_date.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e5ff8f8df4d8..6fe76382d21e 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,10 @@ PHP NEWS . Fixed pthread attribute leak in zend_call_stack_get_netbsd_pthread(). (David Carlier) +- Date: + . Fixed bug GH-24350 (MINIT reads a stale external tz database after an + in-process module restart). (Lazizbek Ergashev) + - DOM: . Fixed bug GH-23352 (UAF reading an attribute value node retained across DOMDocument::adoptNode()). (David Carlier) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 6773fa939e6b..1e5b78652582 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -446,12 +446,13 @@ ZEND_MODULE_POST_ZEND_DEACTIVATE_D(date) /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(date) { + php_date_global_timezone_db = NULL; + php_date_global_timezone_db_enabled = 0; + REGISTER_INI_ENTRIES(); date_register_classes(); register_php_date_symbols(module_number); - php_date_global_timezone_db = NULL; - php_date_global_timezone_db_enabled = 0; DATEG(last_errors) = NULL; return SUCCESS; }