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

Public Member Functions

 __construct (CacheHashCalculator $cacheHashCalculator, TimeTracker $timeTracker)
 
ResponseInterface process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 

Public Attributes

 $queryParams ['id'] = $pageArguments->getPageId()
 

Protected Member Functions

array< string, getRelevantParametersForCacheHashCalculation(PageArguments $pageArguments):array { $queryParams=$pageArguments-> getDynamicArguments ()
 
bool evaluateCacheHashParameter (string $cHash, array $relevantParameters, bool $pageNotFoundOnCacheHashError)
 
bool evaluateQueryParametersWithoutCacheHash (array $dynamicArguments, bool $pageNotFoundOnCacheHashError)
 
 evaluatePageArgumentsWithoutCacheHash (PageArguments $pageArguments, bool $pageNotFoundOnCacheHashError)
 

Protected Attributes

CacheHashCalculator $cacheHashCalculator
 
TimeTracker $timeTracker
 
bool $disableCache = false
 

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 ( CacheHashCalculator  $cacheHashCalculator,
TimeTracker  $timeTracker 
)

Member Function Documentation

◆ evaluateCacheHashParameter()

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

Calculates a hash string based on additional parameters in the url. This is used to cache pages with more parameters than just id and type.

Parameters
string$cHash‪the chash to check
array<string,string>‪$relevantParameters GET parameters necessary for cHash calculation
bool$pageNotFoundOnCacheHashError‪see $GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']
Returns
‪bool if false, then a PageNotFound response is triggered

Definition at line 153 of file PageArgumentValidator.php.

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

◆ evaluatePageArgumentsWithoutCacheHash()

TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::evaluatePageArgumentsWithoutCacheHash ( PageArguments  $pageArguments,
bool  $pageNotFoundOnCacheHashError 
)
protected

No cHash is set but there are query parameters, then calculate a possible cHash from the given query parameters and see if a cHash is returned (similar to comparing this).

Is only called if NO cHash parameter is given.

Definition at line 199 of file PageArgumentValidator.php.

References $GLOBALS, and TYPO3\CMS\Frontend\Middleware\PageArgumentValidator\evaluateQueryParametersWithoutCacheHash().

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

◆ evaluateQueryParametersWithoutCacheHash()

bool TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::evaluateQueryParametersWithoutCacheHash ( array  $dynamicArguments,
bool  $pageNotFoundOnCacheHashError 
)
protected

No cHash is set but there are query parameters, check if that is correct

Should only be called if NO cHash parameter is given.

Parameters
array<string,string|array>‪$dynamicArguments
bool$pageNotFoundOnCacheHashError
Returns
‪bool

Definition at line 178 of file PageArgumentValidator.php.

References TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString().

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

◆ getDynamicArguments()

array<string, getRelevantParametersForCacheHashCalculation(PageArguments $pageArguments): array { $queryParams = $pageArguments-> TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::getDynamicArguments ( )
protected

Filters out the arguments that are necessary for calculating cHash

Parameters
PageArguments$pageArguments
Returns
‪array<string, string>

◆ process()

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

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.

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

◆ $disableCache

bool TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::$disableCache = false
protected

will be used to set $TSFE->no_cache later-on

Definition at line 54 of file PageArgumentValidator.php.

◆ $queryParams

TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::$queryParams[ 'id'] = $pageArguments->getPageId()

◆ $timeTracker

TimeTracker TYPO3\CMS\Frontend\Middleware\PageArgumentValidator::$timeTracker
protected