Bug #78663 [Nab]: Side effects with _SERVER var _SERVER['root']

From: Date: Fri, 11 Oct 2019 17:51:15 +0000
Subject: Bug #78663 [Nab]: Side effects with _SERVER var _SERVER['root']
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223180@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78663&edit=1 ID: 78663 User updated by: flobee at gmail dot com Reported by: flobee at gmail dot com Summary: Side effects with _SERVER var _SERVER['root'] Status: Not a bug Type: Bug Package: *General Issues Operating System: Deb10/ Sury's php packages PHP Version: 7.3.10 Block user comment: N Private report: N New Comment: ahh stupid me! thx! ok, the third party tool seems to change the server vars. Thank you! Please close/ drop it! :-) Previous Comments: ------------------------------------------------------------------------ [2019-10-11 17:38:38] requinix@php.net in_array() looks at array *values*, not keys. ------------------------------------------------------------------------ [2019-10-11 17:37:10] flobee at gmail dot com - PHP 7.3.10-1+0~20191008.45+debian10~1.gbp365209 (cli) (built: Oct 8 2019 05:49:09) ( NTS ) - Linux 4.19.0-6-amd64 # 1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux ------------------------------------------------------------------------ [2019-10-11 17:36:15] flobee at gmail dot com Description: ------------ Hey Some side effects i dont understand to address to but i can confirm the following: Running as 'root' | 'user' var_dump( in_array( 'root', $_SERVER ) ); // true | false var_dump( isset( $_SERVER['root'] ) ); // false | false var_dump( array_key_exists( 'root', $_SERVER ) ); // false | false hmm. So, my break point 'in_array( 'root', $_SERVER ) ? exit(1)..' works. To be save not running scripts under root, but: I miss a documentation/suggestion or is this a bug? Test script: --------------- # Running as 'root' | 'user' var_dump( in_array( 'root', $_SERVER ) ); // true | false var_dump( isset( $_SERVER['root'] ) ); // false | false var_dump( array_key_exists( 'root', $_SERVER ) ); // false | false Expected result: ---------------- depends on implementation/ documentation. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78663&edit=1

« previous php.bugs (#223180) next »