(bug 13689) Page output can be suppressed on Article::purge() by passing bool false...
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 18 Aug 2008 22:21:13 +0000 (22:21 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 18 Aug 2008 22:21:13 +0000 (22:21 +0000)
includes/Article.php

index 7e2b6b7..3a2de38 100644 (file)
@@ -1037,8 +1037,9 @@ class Article {
 
        /**
         * Handle action=purge
+        * @param bool $showPage Show the page after purging?
         */
-       function purge() {
+       function purge( $showPage = true ) {
                global $wgUser, $wgRequest, $wgOut;
 
                if ( $wgUser->isAllowed( 'purge' ) || $wgRequest->wasPosted() ) {
@@ -1058,6 +1059,10 @@ class Article {
                        $wgOut->setRobotPolicy( 'noindex,nofollow' );
                        $wgOut->addHTML( $msg );
                }
+               // Show the page post-purge? 99.99% of the time yes, but sometimes no.
+               if ( $showPage ) {
+                       $this->view();
+               }
        }
 
        /**
@@ -1086,7 +1091,6 @@ class Article {
                        }
                        $wgMessageCache->replace( $this->mTitle->getDBkey(), $text );
                }
-               $this->view();
        }
 
        /**