Project

General

Profile

Actions

Bug #71399

closed

404 page generates an exception below the page

Added by Arek van Schaijk over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-11-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

There seems to be a problem with handling the 404 page in atleast version 7.5 (as far I know) when using SSL.

I've set the [FE][pageNotFound_handling] to "404/" and I'm getting a exception below the generated 404 page.

This seems to cause because the TypoScriptFrontendController->pageErrorHandler() retrieves it's content by using GeneralUtility::getUrl() on line 2110. Since the content is retrieved by GeneralUtility::getUrl() the $_SERVER['HTTP_HOST"] is missing here and this leads to the exception:

Uncaught TYPO3 Exception
#1396795884: The current host header value does not match the configured trusted hosts pattern! Check the pattern defined in $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] and adapt it, if you want to allow the current host header '' for your installation. (More information)

UnexpectedValueException thrown in file
/home/user/domains/example.com/private_html/typo3/sysext/core/Classes/Utility/GeneralUtility.php in line 3372.

7 TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv("HTTP_HOST")

/home/user/domains/example.com/private_html/typo3/sysext/core/Classes/Utility/GeneralUtility.php:
03426:     break;
03427:    case 'TYPO3_REQUEST_HOST':
03428:     $retVal = (self::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://') . self::getIndpEnv('HTTP_HOST');
03429:     break;
03430:    case 'TYPO3_REQUEST_URL':

6 TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv("TYPO3_REQUEST_HOST")

/home/user/domains/example.com/private_html/typo3/sysext/core/Classes/Utility/GeneralUtility.php:
03429:     break;
03430:    case 'TYPO3_REQUEST_URL':
03431:     $retVal = self::getIndpEnv('TYPO3_REQUEST_HOST') . self::getIndpEnv('REQUEST_URI');
03432:     break;
03433:    case 'TYPO3_REQUEST_SCRIPT':

5 TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv("TYPO3_REQUEST_URL")

/home/user/domains/example.com/private_html/typo3/sysext/core/Classes/Http/ServerRequestFactory.php:
00039: 
00040:   $method = isset($serverParameters['REQUEST_METHOD']) ? $serverParameters['REQUEST_METHOD'] : 'GET';
00041:   $uri = new Uri(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
00042: 
00043:   $request = new ServerRequest(

4 TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals()

/home/user/domains/example.com/private_html/typo3/sysext/frontend/Classes/Http/Application.php:
00074:   */
00075:  public function run(callable $execute = NULL) {
00076:   $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
00077: 
00078:   if ($execute !== NULL) {

3 TYPO3\CMS\Frontend\Http\Application::run()

/home/user/domains/example.com/private_html/index.php:
00031: call_user_func(function() {
00032:  $classLoader = require __DIR__ . '/typo3/../vendor/autoload.php';
00033:  (new \TYPO3\CMS\Frontend\Http\Application($classLoader))->run();
00034: });

2 {closure}()
1 call_user_func(Closure)

/home/user/domains/example.com/private_html/index.php:
00032:  $classLoader = require __DIR__ . '/typo3/../vendor/autoload.php';
00033:  (new \TYPO3\CMS\Frontend\Http\Application($classLoader))->run();
00034: });

A temporary workaround for this is to set [FE][pageNotFound_handling] to "REDIRECT:/404/".

Actions

Also available in: Atom PDF