summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerry Weißbach <gerry.w@gammaproduction.de>2014-06-30 09:13:10 +0200
committerGerry Weißbach <gerry.w@gammaproduction.de>2014-06-30 09:13:10 +0200
commit1858e4d7685782550789fd8c228e55ae319bc37a (patch)
treedc7c26081477b74faf12bacf073a09c64af151d7
parent2bc9e7932fca7046e932dc3722bc3f949e086e94 (diff)
downloadrpg-1858e4d7685782550789fd8c228e55ae319bc37a.tar.gz
rpg-1858e4d7685782550789fd8c228e55ae319bc37a.tar.bz2
Check for basedir and baseurl
If these configuration values are not set php will throw an unnecessary NOTICE.
-rw-r--r--inc/init.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/init.php b/inc/init.php
index a937b934d..7340f4191 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -411,7 +411,7 @@ function getBaseURL($abs=null){
//if canonical url enabled always return absolute
if(is_null($abs)) $abs = $conf['canonical'];
- if($conf['basedir']){
+ if(!empty($conf['basedir'])){
$dir = $conf['basedir'];
}elseif(substr($_SERVER['SCRIPT_NAME'],-4) == '.php'){
$dir = dirname($_SERVER['SCRIPT_NAME']);
@@ -438,7 +438,7 @@ function getBaseURL($abs=null){
if(!$abs) return $dir;
//use config option if available, trim any slash from end of baseurl to avoid multiple consecutive slashes in the path
- if($conf['baseurl']) return rtrim($conf['baseurl'],'/').$dir;
+ if(!empty($conf['baseurl'])) return rtrim($conf['baseurl'],'/').$dir;
//split hostheader into host and port
if(isset($_SERVER['HTTP_HOST'])){