From cb7955c3be173d3ca46940e1cc5a15e8e589b429 Mon Sep 17 00:00:00 2001 From: Simon Lieb Date: Tue, 13 Dec 2016 13:38:51 +0100 Subject: [PATCH] Reverse file searching logic --- index.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 544c210..0c2c215 100644 --- a/index.php +++ b/index.php @@ -37,17 +37,14 @@ if (!empty($_GET['url'])) { $findfiles = glob($hashfilepath); - if (empty($findfiles)) { - $content = 'No files.'; + if (!empty($findfiles)) { + $fullfilepath = current($findfiles); - return 1; + header('Location:'.file_get_contents($fullfilepath)); + return 0; } - $fullfilepath = current($findfiles); - - header('Location:'.file_get_contents($fullfilepath)); - - return 0; + $content = 'No link match this identifier.'; } else { $content = '
Enter your URL: