Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxsmin committed Aug 31, 2017
2 parents 40da8d0 + cbe5abe commit 9444ca7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions inc/SP/Core/Init.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public static function isLoggedIn()
private static function checkHttps()
{
if (Checks::forceHttpsIsEnabled() && !Checks::httpsEnabled()) {
$port = ($_SERVER['SERVER_PORT'] !== 443) ? ':' . $_SERVER['SERVER_PORT'] : '';
$port = ((int)$_SERVER['SERVER_PORT'] !== 443) ? ':' . $_SERVER['SERVER_PORT'] : '';
$fullUrl = 'https://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
header('Location: ' . $fullUrl);
}
Expand Down Expand Up @@ -790,4 +790,4 @@ public static function checkPostLoginActions()

return false;
}
}
}
4 changes: 2 additions & 2 deletions inc/SP/Util/Checks.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public static function httpsEnabled()
{
return
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|| $_SERVER['SERVER_PORT'] === 443;
|| (int)$_SERVER['SERVER_PORT'] === 443;
}

/**
Expand All @@ -315,4 +315,4 @@ public static function isJson()
{
return strpos(Request::getRequestHeaders('Accept'), 'application/json') === 0;
}
}
}
4 changes: 2 additions & 2 deletions inc/SP/Util/Util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public static function arrayJSEscape(&$array)
public static function getServerUrl()
{
$urlScheme = Checks::httpsEnabled() ? 'https://' : 'http://';
$urlPort = ($_SERVER['SERVER_PORT'] !== 443) ? ':' . $_SERVER['SERVER_PORT'] : '';
$urlPort = ((int)$_SERVER['SERVER_PORT'] !== 443) ? ':' . $_SERVER['SERVER_PORT'] : '';

return $urlScheme . $_SERVER['SERVER_NAME'] . $urlPort;
}
Expand Down Expand Up @@ -678,4 +678,4 @@ public static function getClientAddress($fullForwarded = false)

return $_SERVER['REMOTE_ADDR'];
}
}
}

0 comments on commit 9444ca7

Please sign in to comment.