Skip to content

Commit

Permalink
* [FIX] Fixes #762. Wrong port replacement when https protocol is for…
Browse files Browse the repository at this point in the history
…ced. Thanks to @lroellin for the feedback.
  • Loading branch information
nuxsmin committed Oct 17, 2017
1 parent 2ff0fe0 commit d3b35be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions inc/SP/Util/HttpUtil.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}

Expand Down
2 changes: 1 addition & 1 deletion inc/SP/Util/Util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public static function getAppInfo($index = null)
*/
public static function getVersion($retBuild = false, $normalized = false)
{
$build = 17101301;
$build = 17101701;
$version = [2, 1, 15];

if ($normalized === true) {
Expand Down

0 comments on commit d3b35be

Please sign in to comment.