From 3fb30f6391fd6e65e213b9685478d4475cf4162e Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 6 Feb 2023 21:31:47 +0100 Subject: [PATCH] fix signature on custom basedir --- index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 693d90d7..e15abb21 100644 --- a/index.php +++ b/index.php @@ -36,8 +36,14 @@ if(0 === strpos($uri, '/')) { $uri = str_replace_first('/', '', $uri); } -if(preg_match("/^[A-Za-z0-9-_%'+]+\.png$/i", $uri)) { - $tmp = explode('.', $uri); +if(preg_match("/^[A-Za-z0-9-_%'+\/]+\.png$/i", $uri)) { + if (!empty(BASE_DIR)) { + $tmp = explode('.', str_replace_first(str_replace_first('/', '', BASE_DIR) . '/', '', $uri)); + } + else { + $tmp = explode('.', $uri); + } + $_REQUEST['name'] = urldecode($tmp[0]); chdir(TOOLS . 'signature');