Skip to content

Commit

Permalink
Fix GH-8310: Registry settings are no longer recognized
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
cmb69 committed Apr 6, 2022
1 parent 187f5a3 commit 1bd9890
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1bd9890

Please sign in to comment.