diff options
author | Andrey Andreev <narf@devilix.net> | 2015-11-09 09:56:49 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-11-09 09:56:49 +0100 |
commit | a706b2baa3cfd6930d2c5588a373ab3b0e561978 (patch) | |
tree | aa0c3c344e62200bb9f2f6dd9c0e792637d28d38 /system | |
parent | 2aff25e8d4d7b29c07803d231532d362a5e457dd (diff) | |
parent | cd4e547abbe9e5f4d48bd54d7fc136a01033b480 (diff) |
Merge branch 'develop' of github.com:bcit-ci/CodeIgniter into develop
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Config.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/system/core/Config.php b/system/core/Config.php index 0264776f9..c507f342c 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -90,7 +90,16 @@ class CI_Config { { if (isset($_SERVER['SERVER_ADDR'])) { - $base_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['SERVER_ADDR'] + if (strpos($_SERVER['SERVER_ADDR'], ':') !== FALSE) + { + $server_addr = '['.$_SERVER['SERVER_ADDR'].']'; + } + else + { + $server_addr = $_SERVER['SERVER_ADDR']; + } + + $base_url = (is_https() ? 'https' : 'http').'://'.$server_addr .substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME']))); } else |