From 46777363ad3de6dcb050ca8dca8242071807669c Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 21 Jan 2008 15:04:49 +0000 Subject: [PATCH] (bug 12716) Unprotecting a non-protected page leaves a log entry --- RELEASE-NOTES | 5 +---- includes/Article.php | 10 +++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 08567dcd50..454766aa16 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -136,10 +136,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10049) Prefix index search and namespaces in Special:Withoutinterwiki * (bug 12668) Support for custom iPhone bookmark icon via $wgAppleTouchIcon * Add option to include templates in Special:Export. -* (bug 12655) Added $wgUserEmailUseReplyTo config option to put sender - address in Reply-To instead of From for user-to-user emails. - This protects against SPF problems and privacy-leaking bounce messages - when using mailers that set the envelope sender to the From header value. === Bug fixes in 1.12 === @@ -326,6 +322,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Creating a site with a name containing '#' is no longer permitted, since the name will not work (but $wgSiteName is not checked if manually set). * (bug 12695) Suppress dvips verbiage from web server error log +* (bug 12716) Unprotecting a non-protected page leaves a log entry == Parser changes in 1.12 == diff --git a/includes/Article.php b/includes/Article.php index 824ccacda3..ce3e402e2e 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1766,9 +1766,6 @@ class Article { if ( $cascade ) $comment .= "$cascade_description"; - $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true ); - $nullRevId = $nullRevision->insertOn( $dbw ); - # Update restrictions table foreach( $limit as $action => $restrictions ) { if ($restrictions != '' ) { @@ -1781,6 +1778,13 @@ class Article { 'pr_type' => $action ), __METHOD__ ); } } + if($dbw->affectedRows() == 0) + // No change + return true; + + # Insert a null revision + $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true ); + $nullRevId = $nullRevision->insertOn( $dbw ); # Update page record $dbw->update( 'page', -- 2.20.1