Fileman: fix path which is not on document root

This commit is contained in:
O3-Shop 2023-04-20 14:46:22 +02:00 committed by Daniel Seifert
parent 17eeefe21f
commit 2ddb643508
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{ {
"FILES_ROOT": "/out/pictures/wysiwigpro", "FILES_ROOT": "out/pictures/wysiwigpro",
"RETURN_URL_PREFIX": "", "RETURN_URL_PREFIX": "",
"SESSION_PATH_KEY": "", "SESSION_PATH_KEY": "",
"THUMBS_VIEW_WIDTH": "140", "THUMBS_VIEW_WIDTH": "140",

View File

@ -89,7 +89,7 @@ function verifyPath(string $path): void
function fixPath(string $path): string function fixPath(string $path): string
{ {
$path = $_SERVER['DOCUMENT_ROOT'] . '/' . $path; $path = dirname($_SERVER['SCRIPT_FILENAME']) . '/../../../../../../' . $path;
$path = str_replace('\\', '/', $path); $path = str_replace('\\', '/', $path);
$path = RoxyFile::FixPath($path); $path = RoxyFile::FixPath($path);
return $path; return $path;
@ -389,7 +389,7 @@ class RoxyFile
public static function FixPath(string $path): string public static function FixPath(string $path): string
{ {
$path = (string) mb_ereg_replace('[\\\/]+', '/', $path); $path = (string) mb_ereg_replace('[\\\/]+', '/', $path);
$path = (string) mb_ereg_replace('\.\.\/', '', $path); //$path = (string) mb_ereg_replace('\.\.\/', '', $path);
return $path; return $path;
} }