From: Antoine Musso Date: Thu, 15 Dec 2005 21:25:52 +0000 (+0000) Subject: Fix #2261: Protect/unprotect do not verify if the page is already X-Git-Tag: 1.6.0~941 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=738b75551661f116ed729acb685b862b5dc247fc;p=lhc%2Fweb%2Fwiklou.git Fix #2261: Protect/unprotect do not verify if the page is already protected/unprotected. Show the article page instead of the confirmation box. --- diff --git a/includes/Article.php b/includes/Article.php index a55858ecd3..fe6ce44e90 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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; + } } /*