‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\Middleware\PageArgumentValidator Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Middleware\PageArgumentValidator:

Public Member Functions

 __construct (TypoScriptFrontendController $controller=null)
 
ResponseInterface process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 

Protected Member Functions

bool evaluateCacheHashParameter (array $queryParams, bool $pageNotFoundOnCacheHashError)
 
TimeTracker getTimeTracker ()
 

Protected Attributes

CacheHashCalculator $cacheHashCalculator
 
TypoScriptFrontendController $controller
 

Detailed Description

This middleware validates given request parameters against the common "cHash" functionality.

Definition at line 38 of file PageArgumentValidator.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::__construct ( TypoScriptFrontendController  $controller = null)
Parameters
TypoScriptFrontendController | null$controller

Definition at line 55 of file PageArgumentValidator.php.

References TYPO3\CMS\Frontend\Middleware\PageArgumentValidator\$controller, and $GLOBALS.

Member Function Documentation

◆ evaluateCacheHashParameter()

bool TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::evaluateCacheHashParameter ( array  $queryParams,
bool  $pageNotFoundOnCacheHashError 
)
protected

Calculates a hash string based on additional parameters in the url.

Calculated hash is stored in $this->controller->cHash_array. This is used to cache pages with more parameters than just id and type.

See also
TypoScriptFrontendController::reqCHash()
Parameters
array<string,string>‪$queryParams GET parameters
bool$pageNotFoundOnCacheHashError‪see $GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']
Returns
‪bool if false, then a PageNotFound response is triggered

Definition at line 111 of file PageArgumentValidator.php.

References TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString(), TYPO3\CMS\Frontend\Middleware\PageArgumentValidator\getTimeTracker(), and TYPO3\CMS\Core\TimeTracker\TimeTracker\setTSlogMessage().

Referenced by TYPO3\CMS\Frontend\Middleware\PageArgumentValidator\process().

◆ getTimeTracker()

TimeTracker TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::getTimeTracker ( )
protected

◆ process()

ResponseInterface TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::process ( ServerRequestInterface  $request,
RequestHandlerInterface  $handler 
)

Validates the &cHash parameter against the other $queryParameters / GET parameters

Parameters
ServerRequestInterface$request
RequestHandlerInterface$handler
Returns
‪ResponseInterface

Definition at line 68 of file PageArgumentValidator.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString(), TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\CACHEHASH_COMPARISON_FAILED, and TYPO3\CMS\Frontend\Middleware\PageArgumentValidator\evaluateCacheHashParameter().

Member Data Documentation

◆ $cacheHashCalculator

CacheHashCalculator TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::$cacheHashCalculator
protected

The cHash Service class used for cHash related functionality

Definition at line 46 of file PageArgumentValidator.php.

◆ $controller

TypoScriptFrontendController TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::$controller
protected