HTMLPurifier 4.4.0
HTMLPurifier_URI Class Reference

HTML Purifier's internal representation of a URI. More...

List of all members.

Public Member Functions

 __construct ($scheme, $userinfo, $host, $port, $path, $query, $fragment)
 getSchemeObj ($config, $context)
 Retrieves a scheme object corresponding to the URI's scheme/default.
 validate ($config, $context)
 Generic validation method applicable for all schemes.
 toString ()
 Convert URI back to string.
 isLocal ($config, $context)
 Returns true if this URL might be considered a 'local' URL given the current context.
 isBenign ($config, $context)
 Returns true if this URL should be considered a 'benign' URL, that is:
 __construct ($scheme, $userinfo, $host, $port, $path, $query, $fragment)
 getSchemeObj ($config, $context)
 Retrieves a scheme object corresponding to the URI's scheme/default.
 validate ($config, $context)
 Generic validation method applicable for all schemes.
 toString ()
 Convert URI back to string.
 isLocal ($config, $context)
 Returns true if this URL might be considered a 'local' URL given the current context.
 isBenign ($config, $context)
 Returns true if this URL should be considered a 'benign' URL, that is:

Public Attributes

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

Detailed Description

HTML Purifier's internal representation of a URI.

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.

Definition at line 11 of file URI.php.


Constructor & Destructor Documentation

HTMLPurifier_URI::__construct ( scheme,
userinfo,
host,
port,
path,
query,
fragment 
)
Note:
Automatically normalizes scheme and port

Definition at line 19 of file URI.php.

References $fragment, $host, $path, $port, $query, $scheme, and $userinfo.

HTMLPurifier_URI::__construct ( scheme,
userinfo,
host,
port,
path,
query,
fragment 
)
Note:
Automatically normalizes scheme and port

Definition at line 7126 of file HTMLPurifier.standalone.php.

References $fragment, $host, $path, $port, $query, $scheme, and $userinfo.


Member Function Documentation

HTMLPurifier_URI::getSchemeObj ( config,
context 
)

Retrieves a scheme object corresponding to the URI's scheme/default.

Parameters:
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context
Returns:
Scheme object appropriate for validating this URI

Definition at line 35 of file URI.php.

References $config, $def, and HTMLPurifier_URISchemeRegistry::instance().

Referenced by isBenign().

HTMLPurifier_URI::getSchemeObj ( config,
context 
)

Retrieves a scheme object corresponding to the URI's scheme/default.

Parameters:
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context
Returns:
Scheme object appropriate for validating this URI

Definition at line 7142 of file HTMLPurifier.standalone.php.

References $config, $def, and HTMLPurifier_URISchemeRegistry::instance().

HTMLPurifier_URI::isBenign ( config,
context 
)

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

Definition at line 225 of file URI.php.

References $config, getSchemeObj(), and isLocal().

HTMLPurifier_URI::isBenign ( config,
context 
)

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

Definition at line 7332 of file HTMLPurifier.standalone.php.

References $config, getSchemeObj(), and isLocal().

HTMLPurifier_URI::isLocal ( config,
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.

Definition at line 7318 of file HTMLPurifier.standalone.php.

References $config.

HTMLPurifier_URI::isLocal ( config,
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.

Definition at line 211 of file URI.php.

References $config.

Referenced by isBenign().

HTMLPurifier_URI::toString ( )

Convert URI back to string.

Returns:
String URI appropriate for output

Definition at line 7280 of file HTMLPurifier.standalone.php.

HTMLPurifier_URI::toString ( )

Convert URI back to string.

Returns:
String URI appropriate for output

Definition at line 173 of file URI.php.

HTMLPurifier_URI::validate ( config,
context 
)

Generic validation method applicable for all schemes.

May modify this URI in order to get it into a compliant form.

Parameters:
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context
Returns:
True if validation/filtering succeeds, false if failure

Definition at line 63 of file URI.php.

References $config, and $def.

HTMLPurifier_URI::validate ( config,
context 
)

Generic validation method applicable for all schemes.

May modify this URI in order to get it into a compliant form.

Parameters:
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context
Returns:
True if validation/filtering succeeds, false if failure

Definition at line 7170 of file HTMLPurifier.standalone.php.

References $config, and $def.


Member Data Documentation

HTMLPurifier_URI::$fragment

Definition at line 14 of file URI.php.

Referenced by __construct().

HTMLPurifier_URI::$host

Definition at line 14 of file URI.php.

Referenced by __construct().

HTMLPurifier_URI::$path

Definition at line 14 of file URI.php.

Referenced by __construct().

HTMLPurifier_URI::$port

Definition at line 14 of file URI.php.

Referenced by __construct().

HTMLPurifier_URI::$query

Definition at line 14 of file URI.php.

Referenced by __construct().

HTMLPurifier_URI::$scheme

Definition at line 14 of file URI.php.

Referenced by __construct().

HTMLPurifier_URI::$userinfo

Definition at line 14 of file URI.php.

Referenced by __construct().


The documentation for this class was generated from the following files: