Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Always return https:// if an SSL proxy server is used
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Sep 26, 2013
1 parent 354b8ce commit 6a1db2a
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions system/modules/core/library/Contao/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,29 +308,15 @@ protected static function ssl()
protected static function url()
{
$host = static::get('httpHost');

// HTTP request
if (!static::get('ssl'))
{
return 'http://' . $host;
}

$xhost = static::get('httpXForwardedHost');

// SSL proxy
if ($xhost != '' && $GLOBALS['TL_CONFIG']['sslProxyDomain'] != '')
if ($xhost != '' && $xhost == $GLOBALS['TL_CONFIG']['sslProxyDomain'])
{
if ($host == $GLOBALS['TL_CONFIG']['sslProxyDomain'])
{
$host = $host . '/' . $xhost;
}
elseif ($xhost == $GLOBALS['TL_CONFIG']['sslProxyDomain'])
{
$host = $xhost . '/' . $host;
}
return 'https://' . $xhost . '/' . $host;
}

return 'https://' . $host;
return (static::get('ssl') ? 'https://' : 'http://') . $host;
}


Expand Down Expand Up @@ -473,19 +459,7 @@ protected static function base()
*/
protected static function host()
{
$host = static::get('httpHost');
$xhost = static::get('httpXForwardedHost');

// SSL proxy
if ($xhost != '' && $GLOBALS['TL_CONFIG']['sslProxyDomain'] != '')
{
if ($host == $GLOBALS['TL_CONFIG']['sslProxyDomain'])
{
$host = $xhost;
}
}

return $host;
return static::get('httpHost');
}


Expand Down

0 comments on commit 6a1db2a

Please sign in to comment.