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
-
bool | $embeds_resource | Does the URI here result in an extra HTTP request? |
Definition at line 23 of file URI.php.
24 {
26 $this->embedsResource = (bool)$embeds_resource;
27 }
Parses a URI into the components and fragment identifier as specified by RFC 3986.
◆ make()
HTMLPurifier_AttrDef_URI::make |
( |
|
$string | ) |
|
◆ validate()
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.
46 {
47 if (
$config->get(
'URI.Disable')) {
48 return false;
49 }
50
52
53
54 $uri = $this->parser->parse($uri);
55 if ($uri === false) {
56 return false;
57 }
58
59
60 $context->register(
'EmbeddedURI', $this->embedsResource);
61
63 do {
64
65
68 break;
69 }
70
71
72 $uri_def =
$config->getDefinition(
'URI');
75 break;
76 }
77
78
80 if (!$scheme_obj) {
81 break;
82 }
83 if ($this->embedsResource && !$scheme_obj->browsable) {
84 break;
85 }
88 break;
89 }
90
91
94 break;
95 }
96
97
99
100 } while (false);
101
104 return false;
105 }
106
107 return $uri->toString();
108 }
parseCDATA($string)
Convenience method that parses a string as if it were CDATA.
References $config, $context, $ok, $result, and HTMLPurifier_AttrDef\parseCDATA().
◆ $embedsResource
HTMLPurifier_AttrDef_URI::$embedsResource |
|
protected |
@type bool
Definition at line 18 of file URI.php.
◆ $parser
HTMLPurifier_AttrDef_URI::$parser |
|
protected |
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php