fix signature on custom basedir

This commit is contained in:
slawkens 2023-02-06 21:31:47 +01:00
parent 91c6ef1ddf
commit 3fb30f6391

View File

@ -36,8 +36,14 @@ if(0 === strpos($uri, '/')) {
$uri = str_replace_first('/', '', $uri); $uri = str_replace_first('/', '', $uri);
} }
if(preg_match("/^[A-Za-z0-9-_%'+]+\.png$/i", $uri)) { if(preg_match("/^[A-Za-z0-9-_%'+\/]+\.png$/i", $uri)) {
$tmp = explode('.', $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]); $_REQUEST['name'] = urldecode($tmp[0]);
chdir(TOOLS . 'signature'); chdir(TOOLS . 'signature');