summaryrefslogtreecommitdiffstats
path: root/system/core/Config.php
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2014-04-01 02:09:25 +0200
committervlakoff <vlakoff@gmail.com>2014-04-01 02:09:25 +0200
commit7ead65b5dc48c477dc3dfe3b969b1e14bb9a1b79 (patch)
treecf1297b535bd9b328caa7b883750ddb99b1e7bc0 /system/core/Config.php
parent3802d7006726451362c9ebd31302d8d6992dd4d5 (diff)
Discard the unwanted changes
Diffstat (limited to 'system/core/Config.php')
-rw-r--r--system/core/Config.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index 41367d353..ad0e5f981 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -76,9 +76,16 @@ class CI_Config {
// Set the base_url automatically if none was provided
if (empty($this->config['base_url']))
{
- $base_url = (is_https() ? 'https' : 'http').'://'
- .(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost')
- .substr($_SERVER['SCRIPT_NAME'], 0, -strlen(basename($_SERVER['SCRIPT_NAME'])));
+ if (isset($_SERVER['HTTP_HOST']))
+ {
+ $base_url = (is_https() ? 'https' : 'http')
+ .'://'.$_SERVER['HTTP_HOST']
+ .substr($_SERVER['SCRIPT_NAME'], 0, -strlen(basename($_SERVER['SCRIPT_NAME'])));
+ }
+ else
+ {
+ $base_url = 'http://localhost/';
+ }
$this->set_item('base_url', $base_url);
}