From: Aaron Date: Fri, 22 Jun 2012 17:47:54 +0000 (-0700) Subject: Added sanity check to WikiPage to avoid duplicate edits. X-Git-Tag: 1.31.0-rc.0~23231^2 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=322f0a99a8686ac8931b6371c0d3ab2adb76a02b;p=lhc%2Fweb%2Fwiklou.git Added sanity check to WikiPage to avoid duplicate edits. Change-Id: I9f5e38d701f60bed582290a7019b559d8415e348 --- diff --git a/includes/WikiPage.php b/includes/WikiPage.php index c203e4fbf4..76a9828269 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -1523,6 +1523,9 @@ class WikiPage extends Page { 'user_text' => $user->getName(), 'timestamp' => $now ) ); + # Bug 37225: use accessor to get the text as Revision may trim it. + # After trimming, the text may be a duplicate of the current text. + $text = $revision->getText(); // sanity; EditPage should trim already $changed = ( strcmp( $text, $oldtext ) != 0 ); @@ -1620,6 +1623,9 @@ class WikiPage extends Page { ) ); $revisionId = $revision->insertOn( $dbw ); + # Bug 37225: use accessor to get the text as Revision may trim it + $text = $revision->getText(); // sanity; EditPage should trim already + # Update the page record with revision data $this->updateRevisionOn( $dbw, $revision, 0 );