Skip to content
Permalink
Browse files Browse the repository at this point in the history
fix: issue #580 using $_SERVER[‘HTTP_HOST’]
  • Loading branch information
David McReynolds committed Aug 6, 2021
1 parent 0902b9d commit 8a0d88a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fuel/modules/fuel/config/fuel_constants.php
Expand Up @@ -70,7 +70,7 @@

if ( ! defined('BASE_URL'))
{
$_base_path = $_SERVER['HTTP_HOST'].str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
$_base_path = $_SERVER['SERVER_NAME'].str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

if ( ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' OR $_SERVER['SERVER_PORT'] == 443)
{
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/libraries/Asset.php
Expand Up @@ -501,7 +501,7 @@ public function assets_path($file = NULL, $path = NULL, $module = NULL, $absolut
if ($absolute)
{
$protocol = ($_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
$path = $protocol.$_SERVER['HTTP_HOST'].$path;
$path = $protocol.$_SERVER['SERVER_NAME'].$path;
}
return $path;
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -110,7 +110,7 @@
$path = str_replace(array(':any', '*'), '.*', str_replace(':num', '[0-9]+', $path));

// Does the RegEx match?
if (!empty($_SERVER['HTTP_HOST']) AND preg_match('#^'.$path.'$#', $_SERVER['HTTP_HOST']))
if (!empty($_SERVER['SERVER_NAME']) AND preg_match('#^'.$path.'$#', $_SERVER['SERVER_NAME']))
{
define('ENVIRONMENT', $env);
break 2;
Expand Down

0 comments on commit 8a0d88a

Please sign in to comment.