RedirectHandler

class \TYPO3\CMS\Redirects\Http\Middleware\RedirectHandler

Implements
MiddlewareInterface, LoggerAwareInterface
Uses
LoggerAwareTrait

Hooks into the frontend request, and checks if a redirect should apply, If so, a redirect response is triggered.

Table of Contents

Interfaces

MiddlewareInterface
LoggerAwareInterface

Properties

$redirectService  : RedirectService

Methods

__construct()  : mixed
process()  : ResponseInterface
buildRedirectResponse()  : ResponseInterface
incrementHitCount()  : void
Updates the sys_redirect's hit counter by one
redirectUriWillRedirectToCurrentUri()  : bool
Checks if redirect uri matches current request uri.
sanitizeUriForComparison()  : UriInterface
Strip down uri to be suitable to make valid comparison in 'redirectUriWillRedirectToCurrentUri()' if uri is pointing to itself and redirect should be processed.

Properties

Methods

process()

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface

Parameters

$request : ServerRequestInterface
$handler : RequestHandlerInterface

Return values

ResponseInterface

buildRedirectResponse()

protected buildRedirectResponse(UriInterface $uri, array $redirectRecord) : ResponseInterface

Parameters

$uri : UriInterface
$redirectRecord : array

Return values

ResponseInterface

incrementHitCount()

Updates the sys_redirect's hit counter by one

protected incrementHitCount(array $redirectRecord) : void

Parameters

$redirectRecord : array

redirectUriWillRedirectToCurrentUri()

Checks if redirect uri matches current request uri.

protected redirectUriWillRedirectToCurrentUri(ServerRequestInterface $request, UriInterface $redirectUri) : bool

Parameters

$request : ServerRequestInterface
$redirectUri : UriInterface

Return values

bool

sanitizeUriForComparison()

Strip down uri to be suitable to make valid comparison in 'redirectUriWillRedirectToCurrentUri()' if uri is pointing to itself and redirect should be processed.

protected sanitizeUriForComparison(UriInterface $uri, bool $relativeCheck) : UriInterface

Parameters

$uri : UriInterface
$relativeCheck : bool

Return values

UriInterface
On this page