From 31286ee002c18f37545a026f1f04771fa7e8fdaa Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 11 Aug 2009 16:36:08 -0500 Subject: [PATCH] Ensure the include path is built from the current path (avoid inclusion mixups when executing libraries from testing scripts) --- main/inc/lib/main_api.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index 39c5797997..57b299879d 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -485,7 +485,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']).'/'; + $incpath = realpath(dirname(__FILE__).'/../'); + return str_replace('\\', '/', $incpath).'/'; break; case LIBRARY_PATH :