Follow-up 2c74b043568e: Restore use of 'clearyourcache' message
authorReedy <reedy@wikimedia.org>
Wed, 18 Apr 2018 15:58:02 +0000 (15:58 +0000)
committerJforrester <jforrester@wikimedia.org>
Wed, 18 Apr 2018 18:39:09 +0000 (18:39 +0000)
Bug: T191800
Change-Id: I632fff6489e929847e7abc1d944277e3b0358314

includes/page/Article.php

index 7577972..48f2ab3 100644 (file)
@@ -577,7 +577,16 @@ class Article implements Page {
                                        # Preload timestamp to avoid a DB hit
                                        $outputPage->setRevisionTimestamp( $this->mPage->getTimestamp() );
 
-                                       if ( !Hooks::run( 'ArticleContentViewCustom',
+                                       # Pages containing custom CSS or JavaScript get special treatment
+                                       if ( $this->getTitle()->isSiteConfigPage() || $this->getTitle()->isUserConfigPage() ) {
+                                               $dir = $this->getContext()->getLanguage()->getDir();
+                                               $lang = $this->getContext()->getLanguage()->getHtmlCode();
+
+                                               $outputPage->wrapWikiMsg(
+                                                       "<div id='mw-clearyourcache' lang='$lang' dir='$dir' class='mw-content-$dir'>\n$1\n</div>",
+                                                       'clearyourcache'
+                                               );
+                                       } elseif ( !Hooks::run( 'ArticleContentViewCustom',
                                                [ $this->fetchContentObject(), $this->getTitle(), $outputPage ] )
                                        ) {
                                                # Allow extensions do their own custom view for certain pages