We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b66df19 + 31cd247 commit c019ad7Copy full SHA for c019ad7
web/config.php
@@ -4,10 +4,12 @@
4
exit('This script cannot be run from the CLI. Run it from a browser.');
5
}
6
7
-if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
8
- '127.0.0.1',
9
- '::1',
10
-))) {
+// This check prevents access to configuration check that are deployed by accident to production servers.
+// Feel free to remove this, extend it, or make something more sophisticated.
+if (isset($_SERVER['HTTP_CLIENT_IP'])
+ || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
11
+ || !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
12
+) {
13
header('HTTP/1.0 403 Forbidden');
14
exit('This script is only accessible from localhost.');
15
0 commit comments