mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Handle reference zvals when outputting superglobals in phpinfo()
Fixes <https://bugs.php.net/80915>. Closes GH-80915. Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
This commit is contained in:
parent
75cb678206
commit
206fd35a98
4
NEWS
4
NEWS
@ -24,6 +24,10 @@ PHP NEWS
|
||||
. Fixed bug #69668 (SOAP special XML characters in namespace URIs not
|
||||
encoded). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80915 (Taking a reference to $_SERVER hides its values from
|
||||
phpinfo()). (Rowan Tommins)
|
||||
|
||||
01 Apr 2021, PHP 7.4.17
|
||||
|
||||
- Core:
|
||||
|
@ -176,7 +176,7 @@ static ZEND_COLD void php_print_gpcse_array(char *name, uint32_t name_length)
|
||||
key = zend_string_init(name, name_length, 0);
|
||||
zend_is_auto_global(key);
|
||||
|
||||
if ((data = zend_hash_find(&EG(symbol_table), key)) != NULL && (Z_TYPE_P(data) == IS_ARRAY)) {
|
||||
if ((data = zend_hash_find_deref(&EG(symbol_table), key)) != NULL && (Z_TYPE_P(data) == IS_ARRAY)) {
|
||||
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_key, string_key, tmp) {
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
php_info_print("<tr>");
|
||||
|
20
ext/standard/tests/bug80915.phpt
Normal file
20
ext/standard/tests/bug80915.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #80915: Taking a reference to $_SERVER hides its values from phpinfo()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$_ENV = [];
|
||||
$_SERVER = [ 'test' => 'test' ];
|
||||
|
||||
$reference =& $_SERVER;
|
||||
|
||||
phpinfo(INFO_VARIABLES);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
phpinfo()
|
||||
|
||||
PHP Variables
|
||||
|
||||
Variable => Value
|
||||
$_SERVER['test'] => test
|
Loading…
Reference in New Issue
Block a user