Last active
May 17, 2017 12:07
-
-
Save tboerger/f244c24a14b047789324fecdb6174b52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/go.php b/go.php | |
| index e14d87db..4919520b 100644 | |
| --- a/go.php | |
| +++ b/go.php | |
| @@ -46,13 +46,11 @@ $mapping = array( | |
| ############# Do not edit below this line ################# | |
| -$from = $_GET['to']; | |
| +$from = isset($_GET['to']) ? $_GET['to'] : ''; | |
| $proto = isset($_SERVER['HTTPS']) ? 'https' : 'http'; | |
| -$port = $_SERVER['SERVER_PORT']; | |
| -$port = ($port !== '80' && $port !== '443') ? ":$port" : ''; | |
| -$name = $_SERVER['SERVER_NAME']; | |
| +$name = $_SERVER['HTTP_HOST']; | |
| $path = dirname($_SERVER['REQUEST_URI']); | |
| -$location = "$proto://$name$port$path"; | |
| +$location = "$proto://$name$path"; | |
| header('HTTP/1.1 302 Moved Temporarily'); | |
| if (array_key_exists($from, $mapping)) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment