Reverse file searching logic

This commit is contained in:
Simon Lieb 2016-12-13 13:38:51 +01:00
parent e9c966061a
commit cb7955c3be

View file

@ -37,17 +37,14 @@ if (!empty($_GET['url'])) {
$findfiles = glob($hashfilepath); $findfiles = glob($hashfilepath);
if (empty($findfiles)) { if (!empty($findfiles)) {
$content = 'No files.';
return 1;
}
$fullfilepath = current($findfiles); $fullfilepath = current($findfiles);
header('Location:'.file_get_contents($fullfilepath)); header('Location:'.file_get_contents($fullfilepath));
return 0; return 0;
}
$content = 'No link match this identifier.';
} else { } else {
$content = '<form method="get"> $content = '<form method="get">
Enter your URL: <input type="text" name="url"><input type="submit" value="Submit"> Enter your URL: <input type="text" name="url"><input type="submit" value="Submit">