mirror of
https://github.com/octfx/mediawiki-extensions-TemplateStylesExtender.git
synced 2024-11-15 03:35:54 +00:00
Fix support for MediaWiki 1.39+ / css-sanitizer 4.0.0+
In css-sanitizer 4.0.0, `MatcherFactory::cssSingleTimingFunction()` was renamed to `cssSingleEasingFunction()`. Therefore, since TemplateStyles on MediaWiki 1.39 uses css-sanitizer 4.0.0, it causes a fatal.
This commit is contained in:
parent
bc9af680cf
commit
1c5862b601
|
@ -55,6 +55,13 @@ class TemplateStylesExtender {
|
|||
] )
|
||||
);
|
||||
|
||||
if ( method_exists( $factory, 'cssSingleEasingFunction' ) ) {
|
||||
// MediaWiki 1.39+ / css-sanitizer 4.0.0+
|
||||
$cssSingleEasingFunction = $factory->cssSingleEasingFunction();
|
||||
} else {
|
||||
$cssSingleEasingFunction = $factory->cssSingleTimingFunction();
|
||||
}
|
||||
|
||||
$anyProperty = Quantifier::star(
|
||||
new Alternative( [
|
||||
$var,
|
||||
|
@ -68,7 +75,7 @@ class TemplateStylesExtender {
|
|||
$factory->frequency(),
|
||||
$factory->resolution(),
|
||||
$factory->position(),
|
||||
$factory->cssSingleTimingFunction(),
|
||||
$cssSingleEasingFunction,
|
||||
$factory->comma(),
|
||||
$factory->cssWideKeywords(),
|
||||
new KeywordMatcher( [
|
||||
|
|
Loading…
Reference in a new issue