mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-14 18:15:57 +00:00
Pass associative array to Sanitizer::validateAttributes
Bug: T255049 Change-Id: I68f122d5a3fa06b0434863cff73851a39dd10514
This commit is contained in:
parent
48b20d9b67
commit
c281e5f423
|
@ -14,7 +14,7 @@
|
|||
"license-name": "GPL-2.0-or-later",
|
||||
"type": "parserhook",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.33",
|
||||
"MediaWiki": ">= 1.34",
|
||||
"platform": {
|
||||
"ability-shell": true
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue