(bug 32434) API allows reblocking the user without reblock parameter.
[lhc/web/wiklou.git] / includes / Article.php
index 8403bc6..5a887b6 100644 (file)
@@ -515,7 +515,7 @@ class Article extends Page {
         * page of the given title.
         */
        public function view() {
-               global $wgParser, $wgUseFileCache, $wgUseETag, $wgDebugToolbar;
+               global $wgUseFileCache, $wgUseETag, $wgDebugToolbar;
 
                wfProfileIn( __METHOD__ );
 
@@ -704,9 +704,8 @@ class Article extends Page {
                                        # Run the parse, protected by a pool counter
                                        wfDebug( __METHOD__ . ": doing uncached parse\n" );
 
-                                       // @todo: shouldn't we be passing $this->getPage() to PoolWorkArticleView instead of plain $this?
-                                       $poolArticleView = new PoolWorkArticleView( $this, $parserOptions,
-                                               $this->getRevIdFetched(), $useParserCache, $this->getContentObject(), $this->getContext() );
+                                       $poolArticleView = new PoolWorkArticleView( $this->getPage(), $parserOptions,
+                                               $this->getRevIdFetched(), $useParserCache, $this->getContentObject() );
 
                                        if ( !$poolArticleView->execute() ) {
                                                $error = $poolArticleView->getError();
@@ -1045,6 +1044,8 @@ class Article extends Page {
         * If patrol is possible, output a patrol UI box. This is called from the
         * footer section of ordinary page views. If patrol is not possible or not
         * desired, does nothing.
+        * Side effect: When the patrol link is build, this method will call
+        * OutputPage::preventClickjacking() and load mediawiki.page.patrol.ajax.
         */
        public function showPatrolFooter() {
                $request = $this->getContext()->getRequest();
@@ -1057,7 +1058,9 @@ class Article extends Page {
                }
 
                $token = $user->getEditToken( $rcid );
+
                $outputPage->preventClickjacking();
+               $outputPage->addModules( 'mediawiki.page.patrol.ajax' );
 
                $link = Linker::linkKnown(
                        $this->getTitle(),