HumHub Documentation (unofficial)

HTMLPurifier_URI
in package

HTML Purifier's internal representation of a URI.

Tags
note

Internal data-structures are completely escaped. If the data needs to be used in a non-URI context (which is very unlikely), be sure to decode it first. The URI may not necessarily be well-formed until validate() is called.

Table of Contents

Properties

$fragment  : mixed
$host  : mixed
$path  : mixed
$port  : mixed
$query  : mixed
$scheme  : mixed
$userinfo  : mixed

Methods

__construct()  : mixed
getSchemeObj()  : HTMLPurifier_URIScheme
Retrieves a scheme object corresponding to the URI's scheme/default
isBenign()  : bool
Returns true if this URL should be considered a 'benign' URL, that is:
isLocal()  : bool
Returns true if this URL might be considered a 'local' URL given the current context. This is true when the host is null, or when it matches the host supplied to the configuration.
toString()  : string
Convert URI back to string
validate()  : bool
Generic validation method applicable for all schemes. May modify this URI in order to get it into a compliant form.

Properties

$fragment

public mixed $fragment
Tags
type

string

$host

public mixed $host
Tags
type

string

$path

public mixed $path
Tags
type

string

$port

public mixed $port
Tags
type

int

$query

public mixed $query
Tags
type

string

$scheme

public mixed $scheme
Tags
type

string

$userinfo

public mixed $userinfo
Tags
type

string

Methods

__construct()

public __construct(string $scheme, string $userinfo, string $host, int $port, string $path, string $query, string $fragment) : mixed
Parameters
$scheme : string
$userinfo : string
$host : string
$port : int
$path : string
$query : string
$fragment : string
Tags
note

Automatically normalizes scheme and port

isLocal()

Returns true if this URL might be considered a 'local' URL given the current context. This is true when the host is null, or when it matches the host supplied to the configuration.

public isLocal(HTMLPurifier_Config $config, HTMLPurifier_Context $context) : bool

Note that this does not do any scheme checking, so it is mostly only appropriate for metadata that doesn't care about protocol security. isBenign is probably what you actually want.

Parameters
$config : HTMLPurifier_Config
$context : HTMLPurifier_Context
Return values
bool

toString()

Convert URI back to string

public toString() : string
Return values
string

URI appropriate for output


        
On this page

Search results