🤖 Rector and PHPCS fixes
This commit is contained in:
parent
78b8232bb0
commit
4847991d4d
12
inc/init.php
12
inc/init.php
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue