unset SERVER to prevent leaks

This commit is contained in:
Dennis Eichhorn 2023-05-06 11:38:01 +00:00
parent 3457f16cd7
commit c81bae26cf

View File

@ -44,6 +44,8 @@ final class UnhandledHandler
'line' => $e->getLine(), 'line' => $e->getLine(),
'file' => $e->getFile(), 'file' => $e->getFile(),
]); ]);
$_SERVER = [];
} }
/** /**
@ -65,6 +67,8 @@ final class UnhandledHandler
if (!(\error_reporting() & $errno)) { if (!(\error_reporting() & $errno)) {
\error_clear_last(); \error_clear_last();
$_SERVER = [];
return false; return false;
} }
@ -77,6 +81,8 @@ final class UnhandledHandler
'file' => $errfile, 'file' => $errfile,
]); ]);
$_SERVER = [];
return true; return true;
} }
@ -94,6 +100,8 @@ final class UnhandledHandler
\error_clear_last(); \error_clear_last();
if ($e === null) { if ($e === null) {
$_SERVER = [];
return; return;
} }
@ -103,5 +111,7 @@ final class UnhandledHandler
'line' => $e['line'], 'line' => $e['line'],
'file' => $e['file'], 'file' => $e['file'],
]); ]);
$_SERVER = [];
} }
} }