Validates shorthand CSS property list-style.
More...
|
| __construct ($config) |
|
| validate ($string, $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 shorthand CSS property list-style.
- Warning
- Does not support url tokens that have internal spaces.
Definition at line 7 of file ListStyle.php.
◆ __construct()
HTMLPurifier_AttrDef_CSS_ListStyle::__construct |
( |
|
$config | ) |
|
- Parameters
-
Definition at line 20 of file ListStyle.php.
22 $def = $config->getCSSDefinition();
23 $this->info[
'list-style-type'] = $def->info[
'list-style-type'];
24 $this->info[
'list-style-position'] = $def->info[
'list-style-position'];
25 $this->info[
'list-style-image'] = $def->info[
'list-style-image'];
◆ validate()
HTMLPurifier_AttrDef_CSS_ListStyle::validate |
( |
|
$string, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
- Parameters
-
- Returns
- bool|string
Definition at line 34 of file ListStyle.php.
References $r, $ret, and HTMLPurifier_AttrDef\parseCDATA().
43 $bits = explode(
' ', strtolower($string));
46 $caught[
'type'] =
false;
47 $caught[
'position'] =
false;
48 $caught[
'image'] =
false;
53 foreach ($bits as $bit) {
60 foreach ($caught as $key => $status) {
61 if ($status !==
false) {
64 $r = $this->info[
'list-style-' . $key]->validate($bit, $config, $context);
74 if ($key ==
'image') {
91 if ($caught[
'type']) {
92 $ret[] = $caught[
'type'];
96 if ($caught[
'image']) {
97 $ret[] = $caught[
'image'];
101 if ($caught[
'position']) {
102 $ret[] = $caught[
'position'];
108 return implode(
' ',
$ret);
parseCDATA($string)
Convenience method that parses a string as if it were CDATA.
◆ $info
HTMLPurifier_AttrDef_CSS_ListStyle::$info |
|
protected |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php