From b123b47aa3f82e88cd93a9849f81e7e50cd2487a Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Sun, 11 Jan 2009 06:51:47 +0100 Subject: [PATCH] [svn r17639] FS#2970 - Advanced file manager: Modification of the configuration option CONFIG_WEBSITE_DOCUMENT_ROOT in order to avoid its manual adjustment in certain cases. --- .../plugins/ajaxfilemanager/inc/config.base.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php index 7e2b984598..5fe8bb271f 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php +++ b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php @@ -170,8 +170,17 @@ * */ + // Modified by Ivan Tcholakov. + //define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); + if (preg_match('@'.api_get_path(REL_PATH).'$@', api_get_path(SYS_PATH))) // Sanity check. + { + define('CONFIG_WEBSITE_DOCUMENT_ROOT', preg_replace('@'.api_get_path(REL_PATH).'$@', '', api_get_path(SYS_PATH))); + } + else + { + define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); // Let the ajaxfilemanager try alone to find the document root. + } - define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); //theme related setting /* * options avaialbe for CONFIG_EDITOR_NAME are: @@ -192,4 +201,4 @@ //$langdokajax= api_get_language_isocode(); //from dokeos. return, en, es... define('CONFIG_LANG_INDEX', 'language'); //the index in the session define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en -?> \ No newline at end of file +?>