X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FArticle.php;h=c865d4ed532f7af69c2a90e71453fd22f4e8db51;hb=c14e9ed13ae7e177afe6c9ffaf39c59f4c8369b8;hp=cd7226700e68b7eabb0b16cb54873fb0d81d7b41;hpb=a2c8c2969420a0f150c03f76e3a0bf9028fcda43;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/Article.php b/includes/page/Article.php index cd7226700e..c865d4ed53 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -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( + "
\n$1\n
", + 'clearyourcache' + ); + } elseif ( !Hooks::run( 'ArticleContentViewCustom', [ $this->fetchContentObject(), $this->getTitle(), $outputPage ] ) ) { # Allow extensions do their own custom view for certain pages @@ -965,7 +974,7 @@ class Article implements Page { * @return bool */ public function showPatrolFooter() { - global $wgUseNPPatrol, $wgUseRCPatrol, $wgUseFilePatrol, $wgEnableAPI, $wgEnableWriteAPI; + global $wgUseNPPatrol, $wgUseRCPatrol, $wgUseFilePatrol; $outputPage = $this->getContext()->getOutput(); $user = $this->getContext()->getUser(); @@ -1056,8 +1065,7 @@ class Article implements Page { 'rc_namespace' => NS_FILE, 'rc_cur_id' => $title->getArticleID() ], - __METHOD__, - [ 'USE INDEX' => 'rc_timestamp' ] + __METHOD__ ); if ( $rc ) { // Use patrol message specific to files @@ -1100,7 +1108,7 @@ class Article implements Page { } $outputPage->preventClickjacking(); - if ( $wgEnableAPI && $wgEnableWriteAPI && $user->isAllowed( 'writeapi' ) ) { + if ( $user->isAllowed( 'writeapi' ) ) { $outputPage->addModules( 'mediawiki.page.patrol.ajax' ); } @@ -1249,7 +1257,7 @@ class Article implements Page { } $dir = $this->getContext()->getLanguage()->getDir(); - $lang = $this->getContext()->getLanguage()->getCode(); + $lang = $this->getContext()->getLanguage()->getHtmlCode(); $outputPage->addWikiText( Xml::openElement( 'div', [ 'class' => "noarticletext mw-content-$dir", 'dir' => $dir,