Skip to content

Commit 8a0d88a

Browse files
author
David McReynolds
committed
fix: issue #580 using $_SERVER[‘HTTP_HOST’]
1 parent 0902b9d commit 8a0d88a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: fuel/modules/fuel/config/fuel_constants.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
if ( ! defined('BASE_URL'))
7272
{
73-
$_base_path = $_SERVER['HTTP_HOST'].str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
73+
$_base_path = $_SERVER['SERVER_NAME'].str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
7474

7575
if ( ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' OR $_SERVER['SERVER_PORT'] == 443)
7676
{

Diff for: fuel/modules/fuel/libraries/Asset.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public function assets_path($file = NULL, $path = NULL, $module = NULL, $absolut
501501
if ($absolute)
502502
{
503503
$protocol = ($_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
504-
$path = $protocol.$_SERVER['HTTP_HOST'].$path;
504+
$path = $protocol.$_SERVER['SERVER_NAME'].$path;
505505
}
506506
return $path;
507507
}

Diff for: index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
$path = str_replace(array(':any', '*'), '.*', str_replace(':num', '[0-9]+', $path));
111111

112112
// Does the RegEx match?
113-
if (!empty($_SERVER['HTTP_HOST']) AND preg_match('#^'.$path.'$#', $_SERVER['HTTP_HOST']))
113+
if (!empty($_SERVER['SERVER_NAME']) AND preg_match('#^'.$path.'$#', $_SERVER['SERVER_NAME']))
114114
{
115115
define('ENVIRONMENT', $env);
116116
break 2;

0 commit comments

Comments
 (0)