r12058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12057‎ | r12058 | r12059 >
Date:12:07, 11 December 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 1600) Trigger edit conflict on duplicate section=new submissions
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -546,11 +546,22 @@
547547
548548 $this->mArticle->clear(); # Force reload of dates, etc.
549549 $this->mArticle->forUpdate( true ); # Lock the article
550 -
551 - if( ( $this->section != 'new' ) &&
552 - ($this->mArticle->getTimestamp() != $this->edittime ) )
553 - {
 550+
 551+ if( $this->mArticle->getTimestamp() != $this->edittime ) {
554552 $this->isConflict = true;
 553+ if( $this->section = 'new' ) {
 554+ if( $this->mArticle->getUserText() == $wgUser->getName() &&
 555+ $this->mArticle->getComment() == $this->summary ) {
 556+ // Probably a duplicate submission of a new comment.
 557+ // This can happen when squid resends a request after
 558+ // a timeout but the first one actually went through.
 559+ wfDebug( "EditPage::editForm duplicate new section submission; trigger edit conflict!\n" );
 560+ } else {
 561+ // New comment; suppress conflict.
 562+ $this->isConflict = false;
 563+ wfDebug( "EditPage::editForm conflict suppressed; new section\n" );
 564+ }
 565+ }
555566 }
556567 $userid = $wgUser->getID();
557568
Index: trunk/phase3/RELEASE-NOTES
@@ -309,6 +309,7 @@
310310 * Use content-lang for sitenotice
311311 * (bug 4233) Update LanguageJa.php
312312 * Fix regression: old version missing from edit links in Nostalgia skin
 313+* (bug 1600) Trigger edit conflict on duplicate section=new submissions
313314
314315
315316 === Caveats ===

Follow-up revisions

RevisionCommit summaryAuthorDate
r32376* (bug 1600) Strip extra == section markup == in new-comment field...brion18:41, 24 March 2008

Status & tagging log