PHP Class HTMLPurifier_URI, yii

Mostrar archivo Open project: yiisoft/yii Class Usage Examples

Public Properties

Property Type Description
$fragment
$host
$path
$port
$query
$scheme
$userinfo

Public Methods

Method Description
__construct ( string $scheme, string $userinfo, string $host, integer $port, string $path, string $query, string $fragment )
getSchemeObj ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : HTMLPurifier_URIScheme Retrieves a scheme object corresponding to the URI's scheme/default
isBenign ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean Returns true if this URL should be considered a 'benign' URL, that is:
isLocal ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean 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 ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean Generic validation method applicable for all schemes. May modify this URI in order to get it into a compliant form.

Method Details

__construct() public method

public __construct ( string $scheme, string $userinfo, string $host, integer $port, string $path, string $query, string $fragment )
$scheme string
$userinfo string
$host string
$port integer
$path string
$query string
$fragment string

getSchemeObj() public method

Retrieves a scheme object corresponding to the URI's scheme/default
public getSchemeObj ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : HTMLPurifier_URIScheme
$config HTMLPurifier_Config
$context HTMLPurifier_Context
return HTMLPurifier_URIScheme Scheme object appropriate for validating this URI

isBenign() public method

- It is a local URL (isLocal), and - It has a equal or better level of security
public isBenign ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean
$config HTMLPurifier_Config
$context HTMLPurifier_Context
return boolean

isLocal() public method

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 isLocal ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean
$config HTMLPurifier_Config
$context HTMLPurifier_Context
return boolean

toString() public method

Convert URI back to string
public toString ( ) : string
return string URI appropriate for output

validate() public method

Generic validation method applicable for all schemes. May modify this URI in order to get it into a compliant form.
public validate ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean
$config HTMLPurifier_Config
$context HTMLPurifier_Context
return boolean True if validation/filtering succeeds, false if failure

Property Details

$fragment public_oe property

public $fragment

$host public_oe property

public $host

$path public_oe property

public $path

$port public_oe property

public $port

$query public_oe property

public $query

$scheme public_oe property

public $scheme

$userinfo public_oe property

public $userinfo