css-sanitizer
Classes to parse and sanitize CSS
|
Base class for CSS sanitizers. More...
Public Member Functions | |
getSanitizationErrors () | |
Return all sanitization errors seen so far. | |
stashSanitizationErrors () | |
Temporarily clear sanitization errors. | |
clearSanitizationErrors () | |
Clear sanitization errors. | |
sanitize (CSSObject $object) | |
Sanitize a CSS object. | |
Protected Member Functions | |
sanitizationError ( $tag, CSSObject $object, array $data=[]) | |
Record a sanitization error. | |
sanitizeObj (Sanitizer $sanitizer, CSSObject $object) | |
Run another sanitizer over a CSSObject. | |
sanitizeList (Sanitizer $sanitizer, CSSObjectList $list) | |
Run a sanitizer over all CSSObjects in a CSSObjectList. | |
sanitizeRules (array $ruleSanitizers, RuleList $list) | |
Run a set of RuleSanitizers over all rules in a RuleList. | |
doSanitize (CSSObject $object) | |
Sanitize a CSS object. | |
Protected Attributes | |
$sanitizationErrors = [] | |
Base class for CSS sanitizers.
|
abstractprotected |
Sanitize a CSS object.
CSSObject | $object |
Reimplemented in Wikimedia\CSS\Sanitizer\FontFaceAtRuleSanitizer, Wikimedia\CSS\Sanitizer\ImportAtRuleSanitizer, Wikimedia\CSS\Sanitizer\KeyframesAtRuleSanitizer, Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer, Wikimedia\CSS\Sanitizer\MediaAtRuleSanitizer, Wikimedia\CSS\Sanitizer\NamespaceAtRuleSanitizer, Wikimedia\CSS\Sanitizer\PageAtRuleSanitizer, Wikimedia\CSS\Sanitizer\PropertySanitizer, Wikimedia\CSS\Sanitizer\StyleAttributeSanitizer, Wikimedia\CSS\Sanitizer\StyleRuleSanitizer, Wikimedia\CSS\Sanitizer\StylesheetSanitizer, and Wikimedia\CSS\Sanitizer\SupportsAtRuleSanitizer.
Wikimedia\CSS\Sanitizer\Sanitizer::getSanitizationErrors | ( | ) |
Return all sanitization errors seen so far.
|
protected |
Record a sanitization error.
string | $tag | Error tag |
CSSObject | $object | Report the error starting at this object |
array | $data | Extra data about the error. |
Wikimedia\CSS\Sanitizer\Sanitizer::sanitize | ( | CSSObject | $object | ) |
Sanitize a CSS object.
CSSObject | $object |
|
protected |
Run a sanitizer over all CSSObjects in a CSSObjectList.
Sanitizer | $sanitizer | |
CSSObjectList | $list |
|
protected |
Run another sanitizer over a CSSObject.
Sanitizer | $sanitizer | |
CSSObject | $object |
|
protected |
Run a set of RuleSanitizers over all rules in a RuleList.
RuleSanitizer[] | $ruleSanitizers | |
RuleList | $list |
Wikimedia\CSS\Sanitizer\Sanitizer::stashSanitizationErrors | ( | ) |
Temporarily clear sanitization errors.
Errors will be cleared, then restored when the returned ScopedCallback goes out of scope or is consumed.