From: Huji Date: Fri, 25 Jan 2008 22:45:56 +0000 (+0000) Subject: (bug 12790) Page protection is not logged when edit-protection is used but move-prote... X-Git-Tag: 1.31.0-rc.0~49775 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=0a57bad31bc2779f5ff06f458edaa8f578013aa0;p=lhc%2Fweb%2Fwiklou.git (bug 12790) Page protection is not logged when edit-protection is used but move-protection is not --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a487b5e18f..59a8b790a2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -340,6 +340,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Security fix for API on MSIE * (bug 12768) Database query syntax error in maintenance/storage/compressOld.inc * (bug 12753) Empty captions in MediaWiki:Sidebar result in PHP errors +* (bug 12790) Page protection is not logged when edit-protection is used and move-protection is not == Parser changes in 1.12 == diff --git a/includes/Article.php b/includes/Article.php index ce3e402e2e..cf05267d01 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1765,7 +1765,8 @@ class Article { $comment .= "$expiry_description"; if ( $cascade ) $comment .= "$cascade_description"; - + + $rowsAffected = false; # Update restrictions table foreach( $limit as $action => $restrictions ) { if ($restrictions != '' ) { @@ -1773,12 +1774,16 @@ 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($dbw->affectedRows() == 0) + if(!$rowsAffected) // No change return true; @@ -1800,6 +1805,8 @@ class Article { # Update the protection log $log = new LogPage( 'protect' ); + + if( $protect ) { $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) );