diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/io.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/io.php index b6158bfa1d..f12611e1ac 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/io.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/io.php @@ -186,6 +186,15 @@ function CreateServerFolder( $folderPath, $lastFolder = null ) function GetRootPath() { + // First, let the system Dokeos tries to determine the system document root path. + + if (preg_match('@'.api_get_path(REL_PATH).'$@', api_get_path(SYS_PATH))) // Sanity check. + { + return str_replace('/', DIRECTORY_SEPARATOR, preg_replace('@'.api_get_path(REL_PATH).'$@', '', api_get_path(SYS_PATH))); + } + + // Next, the original algorithm will try alone to determine the system document root path. + if (!isset($_SERVER)) { global $_SERVER; } @@ -203,7 +212,7 @@ function GetRootPath() // This can check only that this script isn't run from a virtual dir // But it avoids the problems that arise if it isn't checked if ( $position === false || $position <> strlen( $sRealPath ) - strlen( $sSelfPath ) ) - SendError( 1, 'Sorry, the physical root path of the file repository can not be resolved (the function GetRootPath() failed).' ) ; + SendError( 1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".' ) ; return substr( $sRealPath, 0, $position ) ; }