From e98beb0f45d3e35285f96deff55a642a05018d85 Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Tue, 26 Feb 2008 20:41:21 +0000 Subject: [PATCH] (bug 13132) Unable to unprotect pages protected with earlier versions of MediaWiki * Replacing the fix for (bug 12716) Unprotecting a non-protected page leaves a log entry --- RELEASE-NOTES | 1 + includes/Article.php | 8 -------- includes/Title.php | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ffdc603891..cf5b642aa5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -45,6 +45,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Make the default filepageexists message accurate * (bug 12988) $wgMinimalPasswordLength no longer breaks create user by email * (bug 13022) Fix upload from URL on PHP 5.0.x +* (bug 13132) Unable to unprotect pages protected with earlier versions of MediaWiki === API changes in 1.13 === diff --git a/includes/Article.php b/includes/Article.php index 4a18d2b773..68e561ab06 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1771,7 +1771,6 @@ class Article { if ( $cascade ) $comment .= "$cascade_description"; - $rowsAffected = false; # Update restrictions table foreach( $limit as $action => $restrictions ) { if ($restrictions != '' ) { @@ -1779,18 +1778,11 @@ class Article { array( 'pr_page' => $id, 'pr_type' => $action , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ? 1 : 0 , 'pr_expiry' => $encodedExpiry ), __METHOD__ ); - if($dbw->affectedRows() != 0) - $rowsAffected = true; } else { $dbw->delete( 'page_restrictions', array( 'pr_page' => $id, 'pr_type' => $action ), __METHOD__ ); - if($dbw->affectedRows() != 0) - $rowsAffected = true; } } - if(!$rowsAffected) - // No change - return true; # Insert a null revision $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true ); diff --git a/includes/Title.php b/includes/Title.php index 5db668a053..5ed1438a30 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1658,6 +1658,8 @@ class Title { $this->mRestrictions['edit'] = array(); $this->mRestrictions['move'] = array(); + $this->mCascadeRestriction = false; + $this->mRestrictionsExpiry = Block::decodeExpiry(''); # Backwards-compatibility: also load the restrictions from the page record (old format). @@ -1679,8 +1681,6 @@ class Title { } $this->mOldRestrictions = true; - $this->mCascadeRestriction = false; - $this->mRestrictionsExpiry = Block::decodeExpiry(''); } -- 2.20.1