From 63351e4b5078eef4d7ddcc62f54d9ba981f675c7 Mon Sep 17 00:00:00 2001 From: Simon Lieb Date: Tue, 7 Feb 2017 13:07:39 +0100 Subject: [PATCH] Factor out short url in dedicated var --- index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 0c2c215..a42a84e 100644 --- a/index.php +++ b/index.php @@ -25,7 +25,10 @@ if (!empty($_GET['url'])) { mkdir($hashfolderpath, 0700, true); file_put_contents($hashfilepath, $url); - $content = 'http://'.$_SERVER['HTTP_HOST'].'/?'.$urlhash.''; + + $shortUrl = 'http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['SCRIPT_NAME'].'?'.$urlhash; + + $content = ''.$shortUrl.''; } elseif (!empty($_GET)) { $urlhash = key($_GET);