From 306bc3956125b3666d45c3d72b2f8ad52bdef4f1 Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 9 Jul 2012 10:27:53 -0700 Subject: [PATCH] Prevent duplicate edits due to failure to load the current revision. * 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 43932a7ede..8995f3f767 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -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( -- 2.20.1