summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-05-09 22:40:19 +0200
committerandi <andi@splitbrain.org>2005-05-09 22:40:19 +0200
commitbdc127a4dd6155a0da5f6a39fadebbfc5ee0ff1e (patch)
treeddb6365f47618d76b7db0e7501464f21cc860a3a /inc
parentc2819840b8c9eaa0b46a9ec4a674edfd768c8e31 (diff)
downloadrpg-bdc127a4dd6155a0da5f6a39fadebbfc5ee0ff1e.tar.gz
rpg-bdc127a4dd6155a0da5f6a39fadebbfc5ee0ff1e.tar.bz2
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
Diffstat (limited to 'inc')
-rw-r--r--inc/init.php5
1 files changed, 2 insertions, 3 deletions
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']);