From 89253078a3afdf56ceebff445d9ff499cbb431c3 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Fri, 4 Sep 2020 10:22:36 +0200 Subject: [PATCH] Fix file name when URL ends with slash --- helpers.php | 1 + 1 file changed, 1 insertion(+) diff --git a/helpers.php b/helpers.php index 9e8d27a..6f56e48 100644 --- a/helpers.php +++ b/helpers.php @@ -9,6 +9,7 @@ function getFilename($url){ if ($tmp_name[1]) $realfilename = trim($tmp_name[1],'";\''); } else { $stripped_url = preg_replace('/\\?.*/', '', $url); + $stripped_url = preg_replace('/\\/$/', '', $stripped_url); $realfilename = basename($stripped_url); }