From: Brian Wolff Date: Sat, 8 Oct 2016 18:18:06 +0000 (+0000) Subject: Fix merging of class attribute on edit page textbox X-Git-Tag: 1.31.0-rc.0~5171 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=b4b178f4b9d5cc00a4937f542c2e94e3c426169d;p=lhc%2Fweb%2Fwiklou.git Fix merging of class attribute on edit page textbox Follow up to 2c688cfb11ea6cee0e975ed35fc8e503ea Bug: T147701 Change-Id: I48a03ffefb575470804dc4ef54bdf321e6f55dc3 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 8ca7105684..8226da5a78 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3300,17 +3300,28 @@ HTML 'id' => $name, 'cols' => $wgUser->getIntOption( 'cols' ), 'rows' => $wgUser->getIntOption( 'rows' ), - // The following classes can be used here: - // * mw-editfont-default - // * mw-editfont-monospace - // * mw-editfont-sans-serif - // * mw-editfont-serif - 'class' => 'mw-editfont-' . $wgUser->getOption( 'editfont' ), // Avoid PHP notices when appending preferences // (appending allows customAttribs['style'] to still work). 'style' => '' ]; + // The following classes can be used here: + // * mw-editfont-default + // * mw-editfont-monospace + // * mw-editfont-sans-serif + // * mw-editfont-serif + $class = 'mw-editfont-' . $wgUser->getOption( 'editfont' ); + + if ( isset( $attribs['class'] ) ) { + if ( is_string( $attribs['class'] ) ) { + $attribs['class'] .= ' ' . $class; + } elseif ( is_array( $attribs['class'] ) ) { + $attribs['class'][] = $class; + } + } else { + $attribs['class'] = $class; + } + $pageLang = $this->mTitle->getPageLanguage(); $attribs['lang'] = $pageLang->getHtmlCode(); $attribs['dir'] = $pageLang->getDir();