From 2ddb643508f5a59216ec1872b108182b48d786c4 Mon Sep 17 00:00:00 2001 From: O3-Shop Date: Thu, 20 Apr 2023 14:46:22 +0200 Subject: [PATCH] Fileman: fix path which is not on document root --- Application/fileman/conf.json | 2 +- Application/fileman/php/functions.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/fileman/conf.json b/Application/fileman/conf.json index 6662dd2..eadf3c5 100755 --- a/Application/fileman/conf.json +++ b/Application/fileman/conf.json @@ -1,5 +1,5 @@ { - "FILES_ROOT": "/out/pictures/wysiwigpro", + "FILES_ROOT": "out/pictures/wysiwigpro", "RETURN_URL_PREFIX": "", "SESSION_PATH_KEY": "", "THUMBS_VIEW_WIDTH": "140", diff --git a/Application/fileman/php/functions.inc.php b/Application/fileman/php/functions.inc.php index 6d4ed47..8d2faed 100755 --- a/Application/fileman/php/functions.inc.php +++ b/Application/fileman/php/functions.inc.php @@ -89,7 +89,7 @@ function verifyPath(string $path): void function fixPath(string $path): string { - $path = $_SERVER['DOCUMENT_ROOT'] . '/' . $path; + $path = dirname($_SERVER['SCRIPT_FILENAME']) . '/../../../../../../' . $path; $path = str_replace('\\', '/', $path); $path = RoxyFile::FixPath($path); return $path; @@ -389,7 +389,7 @@ class RoxyFile 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); return $path; }