Validates a URI as defined by RFC 3986.
More...
Public Member Functions |
| __construct ($embeds_resource=false) |
| make ($string) |
| validate ($uri, $config, $context) |
| parseCDATA ($string) |
| Convenience method that parses a string as if it were CDATA.
|
Additional Inherited Members |
| $minimized = false |
| Tells us whether or not an HTML attribute is minimized.
|
| $required = false |
| Tells us whether or not an HTML attribute is required.
|
| mungeRgb ($string) |
| Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly.
|
| expandCSSEscape ($string) |
| Parses a possibly escaped CSS string and returns the "pure" version of it.
|
Detailed Description
Validates a URI as defined by RFC 3986.
- Note
- Scheme-specific mechanics deferred to HTMLPurifier_URIScheme
Definition at line 7 of file URI.php.
Constructor & Destructor Documentation
HTMLPurifier_AttrDef_URI::__construct |
( |
|
$embeds_resource = false | ) |
|
- Parameters
-
bool | $embeds_resource | Does the URI here result in an extra HTTP request? |
Definition at line 23 of file URI.php.
{
$this->embedsResource = (bool)$embeds_resource;
}
Member Function Documentation
HTMLPurifier_AttrDef_URI::make |
( |
|
$string | ) |
|
HTMLPurifier_AttrDef_URI::validate |
( |
|
$uri, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
- Parameters
-
- Returns
- bool|string
Reimplemented from HTMLPurifier_AttrDef.
Reimplemented in HTMLPurifier_AttrDef_CSS_URI.
Definition at line 45 of file URI.php.
References $ok, $result, and HTMLPurifier_AttrDef\parseCDATA().
{
if ($config->get('URI.Disable')) {
return false;
}
$uri = $this->parser->parse($uri);
if ($uri === false) {
return false;
}
$context->register('EmbeddedURI', $this->embedsResource);
do {
$result = $uri->validate($config, $context);
break;
}
$uri_def = $config->getDefinition('URI');
$result = $uri_def->filter($uri, $config, $context);
break;
}
$scheme_obj = $uri->getSchemeObj($config, $context);
if (!$scheme_obj) {
break;
}
if ($this->embedsResource && !$scheme_obj->browsable) {
break;
}
$result = $scheme_obj->validate($uri, $config, $context);
break;
}
$result = $uri_def->postFilter($uri, $config, $context);
break;
}
} while (false);
$context->destroy('EmbeddedURI');
return false;
}
return $uri->toString();
}
Field Documentation
HTMLPurifier_AttrDef_URI::$embedsResource |
|
protected |
HTMLPurifier_AttrDef_URI::$parser |
|
protected |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/AttrDef/URI.php