From 1bd9890b20fddbcc8b251210175ddb722bce926c Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 6 Apr 2022 15:25:14 +0200 Subject: [PATCH] Fix GH-8310: Registry settings are no longer recognized `zend_file_handle->filename` is a `zend_string*` pointer now, so we must not cast to `char*` but rather pass the underlying `char*`. Closes GH-8313. --- NEWS | 3 +++ main/main.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 3cef887680d..01271caff93 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.1.6 +- Core: + . Fixed bug GH-8310 (Registry settings are no longer recognized). (cmb) + - Date: . Fixed bug GH-7752 (DateTimeZone::getTransitions() returns insufficient data). (Derick) diff --git a/main/main.c b/main/main.c index 2a417987f31..dc705fcdbdf 100644 --- a/main/main.c +++ b/main/main.c @@ -2489,7 +2489,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file) #ifdef PHP_WIN32 if(primary_file->filename) { - UpdateIniFromRegistry((char*)primary_file->filename); + UpdateIniFromRegistry(ZSTR_VAL(primary_file->filename)); } #endif @@ -2581,7 +2581,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret) zend_try { #ifdef PHP_WIN32 if(primary_file->filename) { - UpdateIniFromRegistry((char*)primary_file->filename); + UpdateIniFromRegistry(ZSTR_VAL(primary_file->filename)); } #endif