ReferrerEnforcer extends ReferrerEnforcer

Treats a referrer as same-origin only if it addresses the install tool entry script (`typo3/install.php`) - and not merely the same host, or the same directory, which is shared with the backend entry point.

Internal

Table of Contents

Constants

TYPE_REFERRER_EMPTY  : mixed = 1
TYPE_REFERRER_SAME_ORIGIN  : mixed = 4
TYPE_REFERRER_SAME_SITE  : mixed = 2

Properties

$request  : ServerRequestInterface
$requestHost  : string

Methods

__construct()  : mixed
handle()  : ResponseInterface|null
resolveAbsoluteWebPath()  : string
resolveReferrerType()  : int
Determines whether the referrer is same-origin (= the very same application), same-site (= the same host, but a different application) or neither of both.
resolveRequestHost()  : string
resolveScriptName()  : string

Constants

TYPE_REFERRER_EMPTY

protected mixed TYPE_REFERRER_EMPTY = 1

TYPE_REFERRER_SAME_ORIGIN

protected mixed TYPE_REFERRER_SAME_ORIGIN = 4

TYPE_REFERRER_SAME_SITE

protected mixed TYPE_REFERRER_SAME_SITE = 2

Properties

$request

protected ServerRequestInterface $request

Methods

__construct()

public __construct(ServerRequestInterface $request) : mixed
Parameters
$request : ServerRequestInterface

handle()

public handle([array<string|int, mixed>|null $options = null ]) : ResponseInterface|null
Parameters
$options : array<string|int, mixed>|null = null
Return values
ResponseInterface|null

resolveAbsoluteWebPath()

protected resolveAbsoluteWebPath(string $target) : string
Parameters
$target : string
Return values
string

resolveReferrerType()

Determines whether the referrer is same-origin (= the very same application), same-site (= the same host, but a different application) or neither of both.

protected resolveReferrerType() : int

Implementations must not fall back to the request directory to detect same-origin: all applications are served from the same entry script, which would make any same-site referrer appear as same-origin.

Return values
int

resolveRequestHost()

protected resolveRequestHost(ServerRequestInterface $request) : string
Parameters
$request : ServerRequestInterface
Return values
string

resolveScriptName()

protected resolveScriptName(ServerRequestInterface $request) : string
Parameters
$request : ServerRequestInterface
Return values
string
On this page

Search results