‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue Class Reference
Inheritance diagram for TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue:
TYPO3\CMS\Core\Http\Uri TYPO3\CMS\Core\Domain\EqualityInterface TYPO3\CMS\Core\Security\ContentSecurityPolicy\CoveringInterface TYPO3\CMS\Core\Security\ContentSecurityPolicy\SourceInterface

Public Member Functions

 __toString ()
 
 equals (EqualityInterface $other)
 
 covers (CoveringInterface $other)
 
 getDomainName ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Http\Uri
 __construct (string $uri='')
 
string getScheme ()
 
string getAuthority ()
 
string getUserInfo ()
 
string getHost ()
 
int null getPort ()
 
string getPath ()
 
string getQuery ()
 
string getFragment ()
 

Static Public Member Functions

static fromUri (UriInterface $other)
 
- ‪Static Public Member Functions inherited from ‪TYPO3\CMS\Core\Http\Uri
static withScheme (string $scheme)
 
static withUserInfo (string $user, ?string $password=null)
 
static withHost (string $host)
 
static withPort (?int $port)
 
static withPath (string $path)
 
static withQuery (string $query)
 
static withFragment (string $fragment)
 

Protected Member Functions

 parseUri (string $uri)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Http\Uri
 isNonStandardPort (string $scheme, string $host, ?int $port)
 
string sanitizeScheme (string $scheme)
 
 sanitizePath (string $path)
 
 sanitizeQuery (string $query)
 
array splitQueryValue (string $value)
 
 sanitizeFragment (string $fragment)
 
 sanitizeQueryOrFragment (string $value)
 

Private Member Functions

 canBeParsedAsDomainName ()
 
 canBeParsedAsWildcardDomainName ()
 
 validateDomainName (string $value)
 

Private Attributes

string $domainName = ''
 
bool $entireWildcard = false
 
bool $domainWildcard = false
 

Additional Inherited Members

- ‪Public Attributes inherited from ‪TYPO3\CMS\Core\Http\Uri
const SUBDELIMITER_CHARLIST = '!\$&\'\‍(\‍)\*\+,;='
 
const UNRESERVED_CHARLIST = 'a-zA-Z0-9_\-\.~'
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Http\Uri
string $scheme = ''
 
array $supportedSchemes
 
string $authority = ''
 
string $userInfo = ''
 
string $host = ''
 
int $port = null
 
string $path = ''
 
string $query = ''
 
string $fragment = ''
 

Detailed Description

Bridge to UriInterface to be used in Content-Security-Policy models, which e.g. supports wildcard domains, like *.typo3.org or https://*.typo3.org.

Definition at line 28 of file UriValue.php.

Member Function Documentation

◆ __toString()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::__toString ( )

Return the string representation as a URI reference.

Depending on which components of the URI are present, the resulting string is either a full URI or relative reference according to RFC 3986, Section 4.1. The method concatenates the various components of the URI, using the appropriate delimiters:

  • ‪If a scheme is present, it MUST be suffixed by ":".
  • ‪If an authority is present, it MUST be prefixed by "//".
  • ‪The path can be concatenated without delimiters. But there are two cases where the path has to be adjusted to make the URI reference valid as PHP does not allow to throw an exception in __toString():
    • ‪If the path is rootless and an authority is present, the path MUST be prefixed by "/".
    • ‪If the path is starting with more than one "/" and no authority is present, the starting slashes MUST be reduced to one.
  • ‪If a query is present, it MUST be prefixed by "?".
  • ‪If a fragment is present, it MUST be prefixed by "#".
See also
https://tools.ietf.org/html/rfc3986#section-4.1

Reimplemented from TYPO3\CMS\Core\Http\Uri.

Definition at line 39 of file UriValue.php.

References TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue\$domainName.

◆ canBeParsedAsDomainName()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::canBeParsedAsDomainName ( )
private

◆ canBeParsedAsWildcardDomainName()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::canBeParsedAsWildcardDomainName ( )
private

◆ covers()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::covers ( CoveringInterface  $other)

◆ equals()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::equals ( EqualityInterface  $other)

Implements TYPO3\CMS\Core\Domain\EqualityInterface.

Definition at line 50 of file UriValue.php.

◆ fromUri()

◆ getDomainName()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::getDomainName ( )

◆ parseUri()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::parseUri ( string  $uri)
protected

◆ validateDomainName()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::validateDomainName ( string  $value)
private

Member Data Documentation

◆ $domainName

string TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::$domainName = ''
private

◆ $domainWildcard

bool TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::$domainWildcard = false
private

Definition at line 32 of file UriValue.php.

◆ $entireWildcard

bool TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue::$entireWildcard = false
private

Definition at line 31 of file UriValue.php.