Skip to content
Snippets Groups Projects
Commit 6db0ff19 authored by Oliver Thiele's avatar Oliver Thiele Committed by Markus Klein
Browse files

[BUGFIX] Also show port when trustedHosts pattern mismatches

Add the port information to the error message when the
trustedHostsPattern mismatches. This is important as
the SERVER_NAME may match, but the SERVER_PORT might be
different from the default ports.

Releases: master, 8.7
Resolves: #83133
Change-Id: I8a25cc0bd2c9578b611986cea4bb7f270dff927b
Reviewed-on: https://review.typo3.org/54821


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
parent ba19b869
Branches
Tags
No related merge requests found
......@@ -74,10 +74,11 @@ class SetupCheck implements CheckInterface
'Trusted hosts pattern is configured to allow current host value.'
));
} else {
$defaultPort = GeneralUtility::getIndpEnv('TYPO3_SSL') ? '443' : '80';
$this->messageQueue->enqueue(new FlashMessage(
'The trusted hosts pattern will be configured to allow all header values. This is because your $SERVER_NAME'
. ' is "' . htmlspecialchars($_SERVER['SERVER_NAME']) . '" while your HTTP_HOST is "'
. htmlspecialchars($_SERVER['HTTP_HOST']) . '". Check the pattern defined in Install Tool -> All'
'The trusted hosts pattern will be configured to allow all header values. This is because your $SERVER_NAME:[defaultPort]'
. ' is "' . $_SERVER['SERVER_NAME'] . ':' . $defaultPort . '" while your HTTP_HOST:SERVER_PORT is "'
. $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'] . '". Check the pattern defined in Install Tool -> All'
. ' configuration -> System -> trustedHostsPattern and adapt it to expected host value(s).',
'Trusted hosts pattern mismatch',
FlashMessage::ERROR
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment