Fix #2261: Protect/unprotect do not verify if the page is already
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 15 Dec 2005 21:25:52 +0000 (21:25 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 15 Dec 2005 21:25:52 +0000 (21:25 +0000)
protected/unprotected.
Show the article page instead of the confirmation box.

includes/Article.php

index a55858e..fe6ce44 100644 (file)
@@ -1585,10 +1585,18 @@ class Article {
                        $wgOut->sysopRequired();
                        return;
                }
+
+               // bug 2261
+               if ( $this->mTitle->isProtected() && $limit == 'sysop' ) {
+                       $this->view();
+                       return;
+               }
+
                if ( wfReadOnly() ) {
                        $wgOut->readOnlyPage();
                        return;
                }
+
                $id = $this->mTitle->getArticleID();
                if ( 0 == $id ) {
                        $wgOut->fatalError( wfMsg( 'badarticleerror' ) );
@@ -1719,7 +1727,13 @@ class Article {
         * Unprotect the pages
         */
        function unprotect() {
-               return $this->protect( '' );
+               // bug 2261
+               if ( $this->mTitle->isProtected() ) {
+                       return $this->protect( '' );
+               } else {
+                       $this->view();
+                       return;
+               }
        }
 
        /*