Class HTMLPurifier_URI
Inheritance | HTMLPurifier_URI |
---|
HTML Purifier's internal representation of a URI.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$fragment | HTMLPurifier_URI | ||
$host | HTMLPurifier_URI | ||
$path | HTMLPurifier_URI | ||
$port | HTMLPurifier_URI | ||
$query | HTMLPurifier_URI | ||
$scheme | HTMLPurifier_URI | ||
$userinfo | HTMLPurifier_URI |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | HTMLPurifier_URI | |
getSchemeObj() | Retrieves a scheme object corresponding to the URI's scheme/default | HTMLPurifier_URI |
isBenign() | Returns true if this URL should be considered a 'benign' URL, that is: | HTMLPurifier_URI |
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. | HTMLPurifier_URI |
toString() | Convert URI back to string | HTMLPurifier_URI |
validate() | Generic validation method applicable for all schemes. May modify this URI in order to get it into a compliant form. | HTMLPurifier_URI |
Property Details
Method Details
public void __construct ( $scheme, $userinfo, $host, $port, $path, $query, $fragment ) | ||
$scheme | string | |
$userinfo | string | |
$host | string | |
$port | int | |
$path | string | |
$query | string | |
$fragment | string |
Retrieves a scheme object corresponding to the URI's scheme/default
public HTMLPurifier_URIScheme getSchemeObj ( $config, $context ) | ||
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context | |
return | HTMLPurifier_URIScheme | Scheme object appropriate for validating this URI |
---|
Returns true if this URL should be considered a 'benign' URL, that is:
- It is a local URL (isLocal), and
- It has a equal or better level of security
public bool isBenign ( $config, $context ) | ||
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context |
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.
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.
public bool isLocal ( $config, $context ) | ||
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context |
Convert URI back to string
public string toString ( ) | ||
return | string | URI appropriate for output |
---|
Generic validation method applicable for all schemes. May modify this URI in order to get it into a compliant form.
public bool validate ( $config, $context ) | ||
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context | |
return | bool | True if validation/filtering succeeds, false if failure |
---|