From fcf48a9add61d08741feec3f3b908b69f930f2ce Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 11 Aug 2009 15:53:24 -0500 Subject: [PATCH] Some notices avoided --- main/inc/lib/main_api.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index 39c5797997..9841bcf7d6 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -198,8 +198,8 @@ define('LOG_CONFIGURATION_SETTINGS_VARIABLE', 'settings_variable'); ============================================================================== */ -// Including extensions to the main API works in two different ways: -if (api_get_path(LIBRARY_PATH) == '/lib/') { +// Including extensions to the main API works in two different ways: +if (api_get_path(LIBRARY_PATH) == '/lib/' || api_get_path(LIBRARY_PATH) == 'lib/') { // when we are running the installer script. require_once 'multibyte_string_functions.lib.php'; } else { @@ -359,7 +359,8 @@ function api_get_path($path_type) { //by default we call the $_configuration['root_web'] we don't query to the DB //$url_info= api_get_access_url(1); //$root_web = $url_info['url']; - $root_web = $_configuration['root_web']; + if(isset($_configuration['root_web'])) + $root_web = $_configuration['root_web']; } else { //we look into the DB the function api_get_access_url //this funcion have a problem because we can't called to the Database:: functions @@ -485,7 +486,8 @@ function api_get_path($path_type) { case INCLUDE_PATH : // Generated by main/inc/global.inc.php // example: /var/www/dokeos/main/inc/ - return str_replace('\\', '/', $GLOBALS['includePath']).'/'; + if (isset($GLOBALS['includePath'])) + return str_replace('\\', '/', $GLOBALS['includePath']).'/'; break; case LIBRARY_PATH :