| Index: trunk/phase3/includes/OutputPage.php |
| — | — | @@ -3166,7 +3166,8 @@ |
| 3167 | 3167 | * @return string |
| 3168 | 3168 | */ |
| 3169 | 3169 | public function buildCssLinks() { |
| 3170 | | - global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs; |
| | 3170 | + global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, |
| | 3171 | + $wgLang, $wgContLang; |
| 3171 | 3172 | |
| 3172 | 3173 | $this->getSkin()->setupSkinUserCss( $this ); |
| 3173 | 3174 | |
| — | — | @@ -3195,8 +3196,15 @@ |
| 3196 | 3197 | $otherTags .= $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES, false, |
| 3197 | 3198 | array( 'excludepage' => $this->getTitle()->getPrefixedDBkey() ) |
| 3198 | 3199 | ); |
| | 3200 | + |
| 3199 | 3201 | // Load the previewed CSS |
| 3200 | | - $otherTags .= Html::inlineStyle( $this->getRequest()->getText( 'wpTextbox1' ) ); |
| | 3202 | + // If needed, Janus it first. This is user-supplied CSS, so it's |
| | 3203 | + // assumed to be right for the content language directionality. |
| | 3204 | + $previewedCSS = $this->getRequest()->getText( 'wpTextbox1' ); |
| | 3205 | + if ( $wgLang->getDir() !== $wgContLang->getDir() ) { |
| | 3206 | + $previewedCSS = CSSJanus::transform( $previewedCSS, true, false ); |
| | 3207 | + } |
| | 3208 | + $otherTags .= Html::inlineStyle( $previewedCSS ); |
| 3201 | 3209 | } else { |
| 3202 | 3210 | // Load the user styles normally |
| 3203 | 3211 | $moduleStyles[] = 'user'; |