From a4cbfcd99a4fef854b2bc912f62ff7de21a6fab1 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 14 Jun 2014 15:04:44 +0100 Subject: [PATCH] This ought to fix a security flaw. --- web/dl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/dl.php b/web/dl.php index bb111a8b6..08478ef5d 100644 --- a/web/dl.php +++ b/web/dl.php @@ -6,10 +6,10 @@ dl_mod($_GET['file']); function dl_mod($mod) { - if(strlen($mod) > 0) { + if(strlen($mod) > 0 && file_exists("files/$mod") && strpos($mod, "/") !== false) { increment_dl_counter($mod); header("Location: files/$mod"); - } + } else echo("Hm, doesn't seem like that file exists :(
Back"); } function increment_dl_counter($mod) {