bug 12716 - trying to unprotect a title that isn't protected no longer generates...
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 3 Jul 2008 05:25:38 +0000 (05:25 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 3 Jul 2008 05:25:38 +0000 (05:25 +0000)
RELEASE-NOTES
includes/Title.php

index 23c776b..5cec8db 100644 (file)
@@ -410,6 +410,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   account creation.
 * (bug 3481) Pages moved shortly after creation are shown at their new title
   on Special:Newpages.
+* (bug 12716) Trying to unprotect a title that isn't protected no longer 
+  generates a log entry.
 
 === API changes in 1.13 ===
 
index 1b0512b..3698791 100644 (file)
@@ -1358,6 +1358,11 @@ class Title {
                        $dbw->delete( 'protected_titles', array( 'pt_namespace' => $namespace,
                                'pt_title' => $title ), __METHOD__ );
                }
+               if($dbw->affectedRows() == 0) {
+                       //No Change
+                       return true;
+               }
+
                # Update the protection log
                $log = new LogPage( 'protect' );