Skip to content

Commit 944a9a5

Browse files
author
Greg Bowler
committed
feature: re-enable protected globals
1 parent bb15961 commit 944a9a5

File tree

3 files changed

+46
-16
lines changed

3 files changed

+46
-16
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
],
88

99
"type": "library",
10-
1110
"require": {
1211
"ext-posix": "*",
1312
"ext-dom": "*",
@@ -21,6 +20,7 @@
2120
"phpgt/database": "^1.4",
2221
"phpgt/http": "^1.1",
2322
"phpgt/logger": "^1.0",
23+
"phpgt/protectedglobal": "^v1.1",
2424
"phpgt/routing": "^1.0",
2525
"phpgt/servicecontainer": "^1.1",
2626
"phpgt/session": "^1.1",

composer.lock

Lines changed: 39 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Middleware/RequestHandler.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,12 @@ public function handle(
215215
$input = new Input($_GET, $_POST, $_FILES);
216216
$serviceContainer->set($input);
217217

218-
// TODO: Re-enable protected globals
219-
// Protection::removeGlobals($GLOBALS, [
220-
// "_GET" => ["xdebug"],
221-
// ]);
222-
// Protection::overrideInternals(
223-
// $GLOBALS,
224-
// $_ENV,
225-
// $_SERVER,
226-
// $_GET,
227-
// $_POST,
228-
// $_FILES,
229-
// $_COOKIE,
230-
// $_SESSION,
231-
// );
218+
Protection::overrideInternals(
219+
Protection::removeGlobals($GLOBALS, [
220+
// TODO: Configure the whitelisted globals.
221+
"_GET" => ["xdebug"],
222+
]
223+
));
232224

233225
$injector = new Injector($serviceContainer);
234226

0 commit comments

Comments
 (0)