File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ header("Content-language: en");
1212header (" Content-type: text/html; charset=utf-8" );
1313
1414/* Fix Silly Same Origin Policies */
15- if (isset($_SERVER[" HTTP_ORIGIN" ])) {
15+ (function() {
16+ if (!isset ($_SERVER[" HTTP_ORIGIN" ])) {
17+ return ;
18+ }
19+
1620 $host = parse_url ($_SERVER[" HTTP_ORIGIN" ]);
1721 if (strncmp (strrev ($host[" host" ]), strrev (" php.net" ), strlen (" php.net" )) != 0 ) {
1822 if ($host[" host" ] != $_SERVER[" SERVER_NAME" ]) {
@@ -32,6 +36,8 @@ if (isset($_SERVER["HTTP_ORIGIN"])) {
3236 header (" Access-Control-Allow-Headers: $headers" );
3337 }
3438}
39+ })();
40+
3541/* Clickjacking workaround. Nothing should be in a frame so it could technically be 'deny'
3642 * but it doesn't make any difference anyway */
3743header (" X-Frame-Options: SAMEORIGIN" );
You can’t perform that action at this time.
0 commit comments