diff --git a/index.php b/index.php
index 0d2b09a..8c7b6ee 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,4 @@
./?'.$urlhash.'
';
- echo 'As long as there is not collision you can shorten it up to 3 characters.';
- return 0;
+ $content = './?'.$urlhash.'
+ As long as there is not collision, you can shorten it down to 3 characters.';
} else if(!empty($_GET)) {
$urlhash = key($_GET);
@@ -33,21 +31,36 @@ if(!empty($_GET['url'])) {
$findfiles = glob($hashfilepath . '*');
if(empty($findfiles)) {
- echo 'No files.';
+ $content .= 'No files.';
return 1;
} else if (count($findfiles) > 1) {
foreach($findfiles as $file) {
$file = str_replace('/', '', substr($file, 5));
- echo './?'.$file.'
';
+ $content .= './?'.$file.'
';
}
- return 1;
}
$fullfilepath = current($findfiles);
header('Location:' . file_get_contents($fullfilepath));
return 0;
+} else {
+ $content = '