(bug 13132) Unable to unprotect pages protected with earlier versions of MediaWiki
authorRotem Liss <rotem@users.mediawiki.org>
Tue, 26 Feb 2008 20:41:21 +0000 (20:41 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Tue, 26 Feb 2008 20:41:21 +0000 (20:41 +0000)
* Replacing the fix for (bug 12716) Unprotecting a non-protected page leaves a log entry

RELEASE-NOTES
includes/Article.php
includes/Title.php

index ffdc603..cf5b642 100644 (file)
@@ -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 ===
 
index 4a18d2b..68e561a 100644 (file)
@@ -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 );
index 5db668a..5ed1438 100644 (file)
@@ -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('');
 
                }