summaryrefslogtreecommitdiffstats
path: root/system/core/Config.php
diff options
context:
space:
mode:
authorSteffen Stollfuß <j0inty@users.noreply.github.com>2015-11-08 20:05:31 +0100
committerSteffen Stollfuß <j0inty@users.noreply.github.com>2015-11-08 20:05:31 +0100
commit49c78f694eded442d95a25feb5bbc69e6bffb205 (patch)
treeae36e42478e17f3d016bb3bd3b86aba0e9f16ca3 /system/core/Config.php
parent81a6f81d88a0cded9fa5617c4bc578311c5bb652 (diff)
parent6c4daef7ace73e1e9bacb511f646ade778763ff9 (diff)
Merge pull request #1 from bcit-ci/develop
Pull current develop branch to submit a bug report later
Diffstat (limited to 'system/core/Config.php')
-rw-r--r--system/core/Config.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index feea7c85a..0264776f9 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -88,11 +88,9 @@ class CI_Config {
// Set the base_url automatically if none was provided
if (empty($this->config['base_url']))
{
- // The regular expression is only a basic validation for a valid "Host" header.
- // It's not exhaustive, only checks for valid characters.
- if (isset($_SERVER['HTTP_HOST']) && preg_match('/^((\[[0-9a-f:]+\])|(\d{1,3}(\.\d{1,3}){3})|[a-z0-9\-\.]+)(:\d+)?$/i', $_SERVER['HTTP_HOST']))
+ if (isset($_SERVER['SERVER_ADDR']))
{
- $base_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST']
+ $base_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['SERVER_ADDR']
.substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME'])));
}
else