‪TYPO3CMS  10.4
TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator Class Reference
Inheritance diagram for TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator:

Public Member Functions

 __construct (?SiteFinder $siteFinder)
 
bool isValid (string $value)
 

Protected Member Functions

bool isInCurrentDomain (string $url)
 
bool isInLocalDomain (string $url)
 
bool isRelativeUrl ($url)
 

Protected Attributes

SiteFinder $siteFinder
 

Detailed Description

Used to check if a referrer or a redirect URL is valid to be used as within Frontend Logins for redirects.

for now as it might get adopted for further streamlining against other validation paradigms

Definition at line 31 of file RedirectUrlValidator.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator::__construct ( ?SiteFinder  $siteFinder)
Parameters
SiteFinder | null$siteFinder

Definition at line 42 of file RedirectUrlValidator.php.

References TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator\$siteFinder.

Member Function Documentation

◆ isInCurrentDomain()

bool TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator::isInCurrentDomain ( string  $url)
protected

Determines whether the URL is on the current host and belongs to the current TYPO3 installation. The scheme part is ignored in the comparison.

Parameters
string$url‪URL to be checked
Returns
‪bool Whether the URL belongs to the current TYPO3 installation

Definition at line 74 of file RedirectUrlValidator.php.

Referenced by TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator\isValid().

◆ isInLocalDomain()

bool TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator::isInLocalDomain ( string  $url)
protected

Determines whether the URL matches a domain known to TYPO3.

Parameters
string$url‪Absolute URL which needs to be checked
Returns
‪bool Whether the URL is considered to be local

Definition at line 88 of file RedirectUrlValidator.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\isValidUrl().

Referenced by TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator\isValid().

◆ isRelativeUrl()

bool TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator::isRelativeUrl (   $url)
protected

Determines whether the URL is relative to the current TYPO3 installation.

Parameters
string$url‪URL which needs to be checked
Returns
‪bool Whether the URL is considered to be relative

Definition at line 111 of file RedirectUrlValidator.php.

Referenced by TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator\isValid().

◆ isValid()

bool TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator::isValid ( string  $value)

Checks if a given URL is valid / properly sanitized and/or the domain is known to TYPO3.

Parameters
string$value
Returns
‪bool

Definition at line 53 of file RedirectUrlValidator.php.

References TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator\isInCurrentDomain(), TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator\isInLocalDomain(), and TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator\isRelativeUrl().

Member Data Documentation

◆ $siteFinder

SiteFinder TYPO3\CMS\FrontendLogin\Validation\RedirectUrlValidator::$siteFinder
protected