Extension:TemplateStyles/Hooks/TemplateStylesPropertySanitizer - MediaWiki


Article Images
TemplateStylesPropertySanitizer
Available from versionĀ ???
Allows for adjusting or replacing the StylePropertySanitizer used when sanitizing style rules. For example, you might add, remove, or redefine known properties.
Define function:
public static function onTemplateStylesPropertySanitizer( Wikimedia\CSS\Sanitizer\StylePropertySanitizer &$propertySanitizer, Wikimedia\CSS\Grammar\MatcherFactory $matcherFactory ) { ... }
Attach hook:
$wgHooks['TemplateStylesPropertySanitizer'][] = 'MyExtensionHooks::onTemplateStylesPropertySanitizer';
Called from:File(s): TemplateStyles / includes/TemplateStylesHooks.php
Function(s): getSanitizer
&$propertySanitizer
Wikimedia\CSS\Sanitizer\StylePropertySanitizer to be used for sanitization.
$matcherFactory
Wikimedia\CSS\Grammar\MatcherFactory being used, for use in adding or redefining known properties or replacing the entire sanitizer.