Check for basedir and baseurl

If these configuration values are not set php will throw an unnecessary
NOTICE.
This commit is contained in:
Gerry Weißbach 2014-06-30 09:13:10 +02:00
parent 2bc9e7932f
commit 1858e4d768
1 changed files with 2 additions and 2 deletions

View File

@ -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'])){