Validates a URI as defined by RFC 3986.
More...
|
| __construct ($embeds_resource=false) |
|
| make ($string) |
|
| validate ($uri, $config, $context) |
|
| validate ($string, $config, $context) |
| Validates and cleans passed string according to a definition. More...
|
|
| parseCDATA ($string) |
| Convenience method that parses a string as if it were CDATA. More...
|
|
| make ($string) |
| Factory method for creating this class from a string. More...
|
|
|
| $minimized = false |
| Tells us whether or not an HTML attribute is minimized. More...
|
|
| $required = false |
| Tells us whether or not an HTML attribute is required. More...
|
|
| mungeRgb ($string) |
| Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. More...
|
|
| expandCSSEscape ($string) |
| Parses a possibly escaped CSS string and returns the "pure" version of it. More...
|
|
Validates a URI as defined by RFC 3986.
- Note
- Scheme-specific mechanics deferred to HTMLPurifier_URIScheme
Definition at line 7 of file URI.php.
◆ __construct()
HTMLPurifier_AttrDef_URI::__construct |
( |
|
$embeds_resource = false | ) |
|
- Parameters
-
$embeds_resource_resource | Does the URI here result in an extra HTTP request? |
Definition at line 16 of file URI.php.
18 $this->embedsResource = (bool) $embeds_resource;
Parses a URI into the components and fragment identifier as specified by RFC 3986.
◆ make()
HTMLPurifier_AttrDef_URI::make |
( |
|
$string | ) |
|
Definition at line 21 of file URI.php.
22 $embeds = ($string ===
'embedded');
Validates a URI as defined by RFC 3986.
◆ validate()
HTMLPurifier_AttrDef_URI::validate |
( |
|
$uri, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
Definition at line 26 of file URI.php.
References $ok, $result, and HTMLPurifier_AttrDef\parseCDATA().
28 if ($config->get(
'URI.Disable'))
return false;
33 $uri = $this->parser->parse($uri);
34 if ($uri ===
false)
return false;
37 $context->register(
'EmbeddedURI', $this->embedsResource);
43 $result = $uri->validate($config, $context);
47 $uri_def = $config->getDefinition(
'URI');
48 $result = $uri_def->filter($uri, $config, $context);
52 $scheme_obj = $uri->getSchemeObj($config, $context);
53 if (!$scheme_obj)
break;
54 if ($this->embedsResource && !$scheme_obj->browsable)
break;
55 $result = $scheme_obj->validate($uri, $config, $context);
59 $result = $uri_def->postFilter($uri, $config, $context);
67 $context->destroy(
'EmbeddedURI');
68 if (!
$ok)
return false;
71 return $uri->toString();
parseCDATA($string)
Convenience method that parses a string as if it were CDATA.
◆ $embedsResource
HTMLPurifier_AttrDef_URI::$embedsResource |
|
protected |
◆ $parser
HTMLPurifier_AttrDef_URI::$parser |
|
protected |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/AttrDef/URI.php