Merge "Account for SkinComponentLink class attribute possibly being an array"

This commit is contained in:
jenkins-bot 2024-07-02 09:55:15 +00:00 committed by Gerrit Code Review
commit 8b6cb95fd7

View file

@ -881,7 +881,15 @@ class Hooks implements
$veEditSectionHint = $tabMessages['editsectionhint'];
$attribs = $result['editsection']['attribs'];
$attribs['class'] = ( $attribs['class'] ?? '' ) . ' mw-editsection-visualeditor';
// class goes to SkinComponentLink which will accept a string or
// an array, and either might be provided at this point.
$class = $attribs['class'] ?? '';
if ( is_array( $class ) ) {
$class[] = 'mw-editsection-visualeditor';
} else {
$class .= ' mw-editsection-visualeditor';
}
$attribs['class'] = $class;
$attribs['title'] = $skin->msg( $veEditSectionHint )
->plaintextParams( $tooltip )
->inLanguage( $lang )->text();