Fileman: fix path which is not on document root
This commit is contained in:
parent
17eeefe21f
commit
2ddb643508
@ -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",
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user