| 219 | | $info = parse_url($_SERVER['HTTP_REFERER']); |
| 220 | | if (isset($info['host']) && !empty($info['host'])) { |
| 221 | | if ($info['host'] != $_SERVER['HTTP_HOST'] |
| 222 | | || $info['host'] != $_SERVER['SERVER_NAME']) { |
| 223 | | set_page_message(tr('Request from foreign host was blocked!')); |
| 224 | | if (!(substr($_SERVER['SCRIPT_FILENAME'], (int)-strlen($_SERVER['REDIRECT_URL']), strlen($_SERVER['REDIRECT_URL'])) === $_SERVER['REDIRECT_URL'])) { |
| 225 | | redirect_to_level_page(); |
| 226 | | } |
| 227 | | } |
| 228 | | } |
| 229 | | } |
| 230 | | } |
| | 219 | $info = parse_url($_SERVER['HTTP_REFERER']); |
| | 220 | if (isset($info['host']) && !empty($info['host'])) { |
| | 221 | if ($info['host'].':'.$_SERVER['SERVER_PORT'] != $_SERVER['HTTP_HOST'] |
| | 222 | || $info['host'].':'.$_SERVER['SERVER_PORT'] != $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']) { |
| | 223 | set_page_message(tr('Request from foreign host was blocked!')); |
| | 224 | if (!(substr($_SERVER['SCRIPT_FILENAME'], (int)-strlen($_SERVER['REDIRECT_URL']), strlen($_SERVER['REDIRECT_URL'])) === $_SERVER['REDIRECT_URL'])) { |
| | 225 | redirect_to_level_page(); |
| | 226 | } |
| | 227 | } |
| | 228 | } |
| | 229 | } |
| | 230 | } |