mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-15 02:24:07 +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",
|
"license-name": "GPL-2.0-or-later",
|
||||||
"type": "parserhook",
|
"type": "parserhook",
|
||||||
"requires": {
|
"requires": {
|
||||||
"MediaWiki": ">= 1.33",
|
"MediaWiki": ">= 1.34",
|
||||||
"platform": {
|
"platform": {
|
||||||
"ability-shell": true
|
"ability-shell": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,9 @@ class SyntaxHighlight {
|
||||||
$out = $result->getValue();
|
$out = $result->getValue();
|
||||||
|
|
||||||
// Allow certain HTML attributes
|
// 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'] ) ) {
|
if ( !isset( $htmlAttribs['class'] ) ) {
|
||||||
$htmlAttribs['class'] = self::HIGHLIGHT_CSS_CLASS;
|
$htmlAttribs['class'] = self::HIGHLIGHT_CSS_CLASS;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue