From 2d7658c8711c1268b6779e14a1d508875cc7d470 Mon Sep 17 00:00:00 2001 From: pips Date: Tue, 13 Dec 2016 13:17:37 +0100 Subject: [PATCH] Add smallHash() function There should no longer be any collision on hashed links. Stolen from shaarli: https://github.com/shaarli/Shaarli/blob/9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a/application/Utils.php#L44 --- index.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index b5ea46b..7c89dcc 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,12 @@ ./?'.$urlhash.'
- As long as there is not collision, you can shorten it down to 3 characters.'; + $content = './?'.$urlhash.''; } elseif (!empty($_GET)) { $urlhash = key($_GET); @@ -34,11 +41,6 @@ if (!empty($_GET['url'])) { $content = 'No files.'; return 1; - } elseif (count($findfiles) > 1) { - foreach ($findfiles as $file) { - $file = str_replace('/', '', substr($file, 5)); - $content = './?'.$file.'
'; - } } $fullfilepath = current($findfiles);