Merge pull request #4159 from dokuwiki/bot/autofix

🤖 Automatic code style fixes
This commit is contained in:
Andreas Gohr 2024-01-26 14:42:16 +01:00 committed by GitHub
commit ed5b1dbc60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;
}