Commit 9dbfb722 authored by Carsten  Rose's avatar Carsten Rose
Browse files

HelperFile.php: correctRelativePathFileName() broken after refactor of qfq paths. Fixes #7540

parent c0444b40
Pipeline #1253 passed with stage
in 1 minute and 57 seconds
...@@ -105,12 +105,16 @@ class HelperFile { ...@@ -105,12 +105,16 @@ class HelperFile {
public static function getFileStat($pathFileName) { public static function getFileStat($pathFileName) {
$vars = array(); $vars = array();
if (empty($pathFileName) || !file_exists ($pathFileName)) { if (empty($pathFileName) ) {
return array(); return array();
} }
$pathFileName = self::correctRelativPathFileName($pathFileName); $pathFileName = self::correctRelativPathFileName($pathFileName);
if(!file_exists ($pathFileName)){
return array();
}
$vars[VAR_FILE_MIME_TYPE] = self::getMimeType($pathFileName); $vars[VAR_FILE_MIME_TYPE] = self::getMimeType($pathFileName);
$vars[VAR_FILE_SIZE] = filesize($pathFileName); $vars[VAR_FILE_SIZE] = filesize($pathFileName);
...@@ -133,7 +137,8 @@ class HelperFile { ...@@ -133,7 +137,8 @@ class HelperFile {
return $pathFileName; return $pathFileName;
} }
if (substr(getcwd(), -8) == '/' . API_DIR_EXT) { $length = strlen('/' . API_DIR_EXT);
if (substr(getcwd(), -$length) == '/' . API_DIR_EXT) {
return '../../../../../' . $pathFileName; return '../../../../../' . $pathFileName;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment