coding style

This commit is contained in:
m-martin-78 2023-11-30 13:46:18 +01:00 committed by GitHub
parent 3e383dbb92
commit 8033346cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -495,7 +495,8 @@ function getBaseURL($abs = null)
//split hostheader into host and port
if (isset($_SERVER['HTTP_HOST'])) {
if ((!empty($conf['trustedproxy'])) && isset($_SERVER['HTTP_X_FORWARDED_HOST']) && preg_match('/'.$conf['trustedproxy'].'/', $_SERVER['REMOTE_ADDR'])) {
if ((!empty($conf['trustedproxy'])) && isset($_SERVER['HTTP_X_FORWARDED_HOST'])
&& preg_match('/' . $conf['trustedproxy'] . '/', $_SERVER['REMOTE_ADDR'])) {
$cur_host = $_SERVER['HTTP_X_FORWARDED_HOST'];
} else {
$cur_host = $_SERVER['HTTP_HOST'];
@ -540,7 +541,9 @@ function getBaseURL($abs = null)
function is_ssl()
{
// check if we are behind a reverse proxy
if ((!empty($conf['trustedproxy'])) && isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && preg_match('/'.$conf['trustedproxy'].'/', $_SERVER['REMOTE_ADDR']) && ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) {
if ((!empty($conf['trustedproxy'])) && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
&& preg_match('/' . $conf['trustedproxy'] . '/', $_SERVER['REMOTE_ADDR'])
&& ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) {
return true;
}