diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2014-03-05 22:04:14 +0000 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2014-03-05 22:04:14 +0000 |
commit | f87b5dbbbad408da775ac4c60ceb9f9666280527 (patch) | |
tree | 53e023772e7ebeb53bad6f13e867483bbed6a683 /inc/init.php | |
parent | 6d2af55dde922ac10a288b4195b1bf338e7bc5a9 (diff) | |
download | rpg-f87b5dbbbad408da775ac4c60ceb9f9666280527.tar.gz rpg-f87b5dbbbad408da775ac4c60ceb9f9666280527.tar.bz2 |
use isset() + ?: or error suppression where value may not be set
Diffstat (limited to 'inc/init.php')
-rw-r--r-- | inc/init.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/init.php b/inc/init.php index 6fb27bd2a..bcd96e5e4 100644 --- a/inc/init.php +++ b/inc/init.php @@ -441,12 +441,12 @@ function getBaseURL($abs=null){ //split hostheader into host and port if(isset($_SERVER['HTTP_HOST'])){ $parsed_host = parse_url('http://'.$_SERVER['HTTP_HOST']); - $host = $parsed_host['host']; - $port = $parsed_host['port']; + $host = isset($parsed_host['host']) ? $parsed_host['host'] : null; + $port = isset($parsed_host['port']) ? $parsed_host['port'] : null; }elseif(isset($_SERVER['SERVER_NAME'])){ $parsed_host = parse_url('http://'.$_SERVER['SERVER_NAME']); - $host = $parsed_host['host']; - $port = $parsed_host['port']; + $host = isset($parsed_host['host']) ? $parsed_host['host'] : null; + $port = isset($parsed_host['port']) ? $parsed_host['port'] : null; }else{ $host = php_uname('n'); $port = ''; |