summaryrefslogtreecommitdiff
path: root/inc/init.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-10-16 00:17:19 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-10-16 00:17:19 +0200
commit89aa05db68b9325156c9ad68b372b3601fac784f (patch)
treecf911c5931dc8338413bf8d2e5b70b2af3a769fd /inc/init.php
parent55a96b7b706140b2041fff7d2a4bad5b44c12d97 (diff)
downloadrpg-89aa05db68b9325156c9ad68b372b3601fac784f.tar.gz
rpg-89aa05db68b9325156c9ad68b372b3601fac784f.tar.bz2
improvement for baseurl detection tests added
darcs-hash:20051015221719-7ad00-efd98fdcf381ae38186578a16159ad2d279cf5af.gz
Diffstat (limited to 'inc/init.php')
-rw-r--r--inc/init.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/init.php b/inc/init.php
index 4b01a1240..108ed615c 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -157,14 +157,16 @@ function getBaseURL($abs=false){
if($conf['basedir']){
$dir = $conf['basedir'].'/';
- }elseif($_SERVER['SCRIPT_NAME']){
+ }elseif(substr($_SERVER['SCRIPT_NAME'],-4) == '.php'){
$dir = dirname($_SERVER['SCRIPT_NAME']).'/';
+ }elseif(substr($_SERVER['PHP_SELF'],-4) == '.php'){
+ $dir = dirname($_SERVER['PHP_SELF']).'/';
}elseif($_SERVER['DOCUMENT_ROOT'] && $_SERVER['SCRIPT_FILENAME']){
$dir = preg_replace ('/^'.preg_quote($_SERVER['DOCUMENT_ROOT'],'/').'/','',
$_SERVER['SCRIPT_FILENAME']);
$dir = dirname('/'.$dir).'/';
}else{
- $dir = dirname($_SERVER['PHP_SELF']).'/';
+ $dir = './'; //probably wrong
}
$dir = str_replace('\\','/',$dir); #bugfix for weird WIN behaviour