Reverting r39619 "(bug 13689) Page output can be suppressed on Article::purge() by...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 19 Aug 2008 18:58:50 +0000 (18:58 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 19 Aug 2008 18:58:50 +0000 (18:58 +0000)
Article::purge() is a UI action entry point, not a backend method. Backend-only parameters aren't appropriate here; instead a method suitable for backend usage should be created (and/or in an ideal world, we should finish splitting Article backend stuff from UI frontend as separate classes)

includes/Article.php

index 3a2de38..7e2b6b7 100644 (file)
@@ -1037,9 +1037,8 @@ class Article {
 
        /**
         * Handle action=purge
-        * @param bool $showPage Show the page after purging?
         */
-       function purge( $showPage = true ) {
+       function purge() {
                global $wgUser, $wgRequest, $wgOut;
 
                if ( $wgUser->isAllowed( 'purge' ) || $wgRequest->wasPosted() ) {
@@ -1059,10 +1058,6 @@ 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();
-               }
        }
 
        /**
@@ -1091,6 +1086,7 @@ class Article {
                        }
                        $wgMessageCache->replace( $this->mTitle->getDBkey(), $text );
                }
+               $this->view();
        }
 
        /**