Prevent duplicate edits due to failure to load the current revision.
authorAaron <aschulz@wikimedia.org>
Mon, 9 Jul 2012 17:27:53 +0000 (10:27 -0700)
committerAaron <aschulz@wikimedia.org>
Mon, 9 Jul 2012 17:34:33 +0000 (10:34 -0700)
* This works via throwing an exception. Ideally, a deeper fix can be
  made so the exception stops getting triggered anymore.

Change-Id: Ie6a11016be9f9e5a76e2f6f369bc3aac42d78c2d

includes/WikiPage.php

index 43932a7..8995f3f 100644 (file)
@@ -1487,6 +1487,10 @@ class WikiPage extends Page {
 
                                wfProfileOut( __METHOD__ );
                                return $status;
+                       } elseif ( $oldtext === false ) {
+                               # Sanity check for bug 37225
+                               wfProfileOut( __METHOD__ );
+                               throw new MWException( "Could not find text for current revision {$oldid}." );
                        }
 
                        $revision = new Revision( array(