fixed undefined index $GLOBALS when auto_globals_jit is enabled

This commit is contained in:
Markus Staab
2017-03-06 09:24:44 +01:00
committed by GitHub
parent 1a8192deae
commit e316e7d257
+10 -10
View File
@@ -234,13 +234,13 @@ class PrettyPageHandler extends Handler
"has_frames_tabs" => $this->getApplicationPaths(),
"tables" => [
"GET Data" => $this->masked('_GET'),
"POST Data" => $this->masked('_POST'),
"Files" => $this->masked('_FILES'),
"Cookies" => $this->masked('_COOKIE'),
"GET Data" => $this->masked($_GET, '_GET'),
"POST Data" => $this->masked($_POST, '_POST'),
"Files" => isset($_FILES) ? $this->masked($_FILES, '_FILES') : [],
"Cookies" => $this->masked($_COOKIE, '_COOKIE'),
"Session" => isset($_SESSION) ? $this->masked('_SESSION') : [],
"Server/Request Data" => $this->masked('_SERVER'),
"Environment Variables" => $this->masked('_ENV'),
"Server/Request Data" => $this->masked($_SERVER, '_SERVER'),
"Environment Variables" => $this->masked($_ENV, '_ENV'),
],
];
@@ -658,16 +658,16 @@ class PrettyPageHandler extends Handler
* Checks all values identified by the given superGlobalName within GLOBALS.
* Blacklisted values will be replaced by a equal length string cointaining only '*' characters.
*
* @param $superGlobal array One of the superglobal arrays
* @param $superGlobalName string the name of the superglobal array, e.g. '_GET'
* @return array $values without sensitive data
*/
private function masked($superGlobalName) {
private function masked(array $superGlobal, $superGlobalName) {
$blacklisted = $this->blacklist[$superGlobalName];
$values = $GLOBALS[$superGlobalName];
foreach($blacklisted as $key) {
if (isset($values[$key])) {
$values[$key] = str_repeat('*', strlen($values[$key]));
if (isset($superGlobal[$key])) {
$superGlobal[$key] = str_repeat('*', strlen($superGlobal[$key]));
}
}
return $values;