🤖 Rector and PHPCS fixes

This commit is contained in:
splitbrain 2024-01-26 11:56:43 +00:00 committed by GitHub
parent 78b8232bb0
commit 4847991d4d
1 changed files with 8 additions and 4 deletions

View File

@ -495,8 +495,10 @@ 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'];
@ -541,9 +543,11 @@ 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'])
if (
(!empty($conf['trustedproxy'])) && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
&& preg_match('/' . $conf['trustedproxy'] . '/', $_SERVER['REMOTE_ADDR'])
&& ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) {
&& ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
) {
return true;
}