Skip to content

Commit b3a7233

Browse files
committed
tweak: don't remove globals on error request handler
1 parent fcdaf6c commit b3a7233

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Middleware/RequestHandler.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ protected function handleCsrf(ServerRequestInterface $request):void {
357357
}
358358

359359
protected function handleProtectedGlobals():void {
360+
if($this instanceof ErrorRequestHandler) {
361+
// ErrorRequestHandler extends RequestHander, so this has already been done.
362+
return;
363+
}
364+
360365
Protection::overrideInternals(
361366
Protection::removeGlobals($GLOBALS, [
362367
"_ENV" => explode(",", $this->config->getString("app.globals_whitelist_env") ?? ""),
@@ -366,7 +371,8 @@ protected function handleProtectedGlobals():void {
366371
"_FILES" => explode(",", $this->config->getString("app.globals_whitelist_files") ?? ""),
367372
"_COOKIES" => explode(",", $this->config->getString("app.globals_whitelist_cookies") ?? ""),
368373
]
369-
));
374+
)
375+
);
370376
}
371377

372378
protected function handleLogicExecution(Assembly $logicAssembly, ?Element $component = null):void {

0 commit comments

Comments
 (0)