From 33dffbed891ce35991ca68c229e9e7ffcc698a45 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Fri, 22 Mar 2013 22:52:11 +0300 Subject: [PATCH] Only disallow hotlinking for main server --- index.php.template.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php.template.txt b/index.php.template.txt index 3faee9be2..dad6b6a8d 100644 --- a/index.php.template.txt +++ b/index.php.template.txt @@ -2,7 +2,7 @@ // no direct linking to the lobby if ($_SERVER['REQUEST_URI'] === '/' || $_SERVER['REQUEST_URI'] === '/lobby') { - if (!empty($_SERVER['HTTP_REFERER']) && !preg_match('/^https?:\/\/([a-z0-9-]+.)?(pokemonshowdown\.com|appjs)/', $_SERVER['HTTP_REFERER'])) { + if (!empty($_SERVER['HTTP_REFERER']) && !preg_match('/^https?:\/\/([a-z0-9-]+.)?(pokemonshowdown\.com|appjs)/', $_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_HOST'] === 'play.pokemonshowdown.com') { header('HTTP/1.1 303 See Other'); header('Location: http://pokemonshowdown.com/'); die();