* [FIX] Fixes #762. Wrong port replacement when https protocol is forced. Thanks to @lroellin for the feedback.

This commit is contained in:
nuxsmin
2017-10-17 08:59:36 +02:00
parent 2ff0fe000a
commit d3b35bea92
2 changed files with 6 additions and 4 deletions

View File

@@ -39,10 +39,12 @@ class HttpUtil
public static function checkHttps()
{
if (Checks::forceHttpsIsEnabled() && !Checks::httpsEnabled()) {
$port = ((int)$_SERVER['SERVER_PORT'] !== 443) ? ':' . $_SERVER['SERVER_PORT'] : '';
$host = str_replace('http', 'https', self::getHttpHost());
$serverPort = (int)$_SERVER['SERVER_PORT'];
header('Location: ' . $host . $port . $_SERVER['REQUEST_URI']);
$httpPort = $serverPort !== 443 && $serverPort !== 80 ? $serverPort : '';
$httpHost = str_replace('http', 'https', self::getHttpHost());
header('Location: ' . $httpHost . ':' . $httpPort . $_SERVER['REQUEST_URI']);
}
}

View File

@@ -386,7 +386,7 @@ class Util
*/
public static function getVersion($retBuild = false, $normalized = false)
{
$build = 17101301;
$build = 17101701;
$version = [2, 1, 15];
if ($normalized === true) {