diff --git a/extension.json b/extension.json index 7c229139..adcefcb8 100644 --- a/extension.json +++ b/extension.json @@ -14,7 +14,7 @@ "license-name": "GPL-2.0-or-later", "type": "parserhook", "requires": { - "MediaWiki": ">= 1.33", + "MediaWiki": ">= 1.34", "platform": { "ability-shell": true } diff --git a/includes/SyntaxHighlight.php b/includes/SyntaxHighlight.php index 3ed48f0a..748b1125 100644 --- a/includes/SyntaxHighlight.php +++ b/includes/SyntaxHighlight.php @@ -121,7 +121,9 @@ class SyntaxHighlight { $out = $result->getValue(); // Allow certain HTML attributes - $htmlAttribs = Sanitizer::validateAttributes( $args, [ 'style', 'class', 'id', 'dir' ] ); + $htmlAttribs = Sanitizer::validateAttributes( + $args, array_flip( [ 'style', 'class', 'id', 'dir' ] ) + ); if ( !isset( $htmlAttribs['class'] ) ) { $htmlAttribs['class'] = self::HIGHLIGHT_CSS_CLASS; } else {