Validates based on {ident} CSS grammar production.
More...
Public Member Functions |
| validate ($string, $config, $context) |
| parseCDATA ($string) |
| Convenience method that parses a string as if it were CDATA.
|
| make ($string) |
| Factory method for creating this class from a string.
|
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 based on {ident} CSS grammar production.
Definition at line 6 of file Ident.php.
Member Function Documentation
HTMLPurifier_AttrDef_CSS_Ident::validate |
( |
|
$string, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
- Parameters
-
- Returns
- bool|string
Reimplemented from HTMLPurifier_AttrDef.
Definition at line 15 of file Ident.php.
{
$string = trim($string);
if (!$string) {
return false;
}
$pattern = '/^(-?[A-Za-z_][A-Za-z_\-0-9]*)$/';
if (!preg_match($pattern, $string)) {
return false;
}
return $string;
}
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php