From bdc127a4dd6155a0da5f6a39fadebbfc5ee0ff1e Mon Sep 17 00:00:00 2001 From: andi Date: Mon, 9 May 2005 22:40:19 +0200 Subject: use SCRIPT_NAME instead of REQUEST_URI in getBaseName REQUEST_URI breaks on directory access (eg. /dokuwiki/) and with the internal rewrite. SCRIPT_NAME should always work. Counter-Examples welcome darcs-hash:20050509204019-9977f-ff5220346347575449734d5fd80fe9b85e5517c2.gz --- inc/init.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/init.php b/inc/init.php index f3c428058..cef7da9f9 100644 --- a/inc/init.php +++ b/inc/init.php @@ -99,9 +99,8 @@ function getBaseURL($abs=false){ if($conf['basedir']){ $dir = $conf['basedir']; - }elseif($_SERVER['REQUEST_URI']){ - $dir = dirname($_SERVER['REQUEST_URI']).'/'; - + }elseif($_SERVER['SCRIPT_NAME']){ + $dir = dirname($_SERVER['SCRIPT_NAME']).'/'; }elseif($_SERVER['DOCUMENT_ROOT'] && $_SERVER['SCRIPT_FILENAME']){ $dir = preg_replace ('/^'.preg_quote($_SERVER['DOCUMENT_ROOT'],'/').'/','', $_SERVER['SCRIPT_FILENAME']); -- cgit v1.2.3