summaryrefslogtreecommitdiff
path: root/inc/init.php
diff options
context:
space:
mode:
authorAdrian Lang <dokuwiki@adrianlang.de>2011-01-14 21:45:52 +0100
committerAdrian Lang <dokuwiki@adrianlang.de>2011-01-14 21:45:52 +0100
commit731ae6527af8e2b8cdb211aecac260988e8379e9 (patch)
treea44a5637394e7fee3c5835e3955cd716699bbea8 /inc/init.php
parentfa7c70ff4d7f9999466436e7d559eb0c81571779 (diff)
parent301971b3769a2d1a440cf58fd84f2c100a1348e3 (diff)
downloadrpg-731ae6527af8e2b8cdb211aecac260988e8379e9.tar.gz
rpg-731ae6527af8e2b8cdb211aecac260988e8379e9.tar.bz2
Merge branch 'master' of github.com:splitbrain/dokuwiki
Diffstat (limited to 'inc/init.php')
-rw-r--r--inc/init.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/inc/init.php b/inc/init.php
index ed4409729..3b438f15b 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -419,12 +419,16 @@ function getBaseURL($abs=null){
if($conf['baseurl']) return rtrim($conf['baseurl'],'/').$dir;
//split hostheader into host and port
- $addr = explode(':',$_SERVER['HTTP_HOST']);
- $host = $addr[0];
- $port = '';
- if (isset($addr[1])) {
- $port = $addr[1];
- } elseif (isset($_SERVER['SERVER_PORT'])) {
+ if(isset($_SERVER['HTTP_HOST'])){
+ list($host,$port) = explode(':',$_SERVER['HTTP_HOST']);
+ }elseif(isset($_SERVER['SERVER_NAME'])){
+ list($host,$port) = explode(':',$_SERVER['SERVER_NAME']);
+ }else{
+ $host = php_uname('n');
+ $port = '';
+ }
+
+ if(!$port && isset($_SERVER['SERVER_PORT'])) {
$port = $_SERVER['SERVER_PORT'];
}
if(!is_ssl()){