summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-04-01 10:49:44 +0200
committerAndrey Andreev <narf@devilix.net>2014-04-01 10:49:44 +0200
commitb749fab66f46176f54ea84b89ca5f5bac3b517a4 (patch)
tree0d929cc7983146a13dd9db8cf4b67bc7a1e23afa /system
parent0a002014c2099602cb7143eca850b0acbe898d2f (diff)
parent7ead65b5dc48c477dc3dfe3b969b1e14bb9a1b79 (diff)
Merge pull request #2981 from vlakoff/base_url
Work on determination of "base_url" config item
Diffstat (limited to 'system')
-rw-r--r--system/core/Config.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index f630d1709..ad0e5f981 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -78,9 +78,9 @@ class CI_Config {
{
if (isset($_SERVER['HTTP_HOST']))
{
- $base_url = is_https() ? 'https' : 'http';
- $base_url .= '://'.$_SERVER['HTTP_HOST']
- .str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
+ $base_url = (is_https() ? 'https' : 'http')
+ .'://'.$_SERVER['HTTP_HOST']
+ .substr($_SERVER['SCRIPT_NAME'], 0, -strlen(basename($_SERVER['SCRIPT_NAME'])));
}
else
{