Reverse file searching logic

This commit is contained in:
pips 2016-12-13 13:38:51 +01:00
parent d0978c92c6
commit 14ce46861e

View file

@ -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 = '<form method="get">
Enter your URL: <input type="text" name="url"><input type="submit" value="Submit">