From ec3c3238e636e970efd6d7408ea7db79ee15f6c4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 16 Jan 2009 19:56:57 +0000 Subject: [PATCH] (bug 1181) Don't try to replace the whole page with one section if replaceSection() fails --- includes/EditPage.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index cbd5aa4dbb..837447a935 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -918,10 +918,8 @@ class EditPage { if ( is_null( $text ) ) { wfDebug( "EditPage::editForm activating conflict; section replace failed.\n" ); $this->isConflict = true; - $text = $this->textbox1; - } - - if ( $this->isConflict ) { + $text = $this->textbox1; // do not try to merge here! + } else if ( $this->isConflict ) { # Attempt merge if ( $this->mergeChangesInto( $text ) ) { // Successful merge! Maybe we should tell the user the good news? @@ -1149,9 +1147,7 @@ class EditPage { if ( $this->section != '' && $this->section != 'new' ) { $matches = array(); if ( !$this->summary && !$this->preview && !$this->diff ) { - preg_match( "/^(=+)(.+)\\1/mi", - $this->textbox1, - $matches ); + preg_match( "/^(=+)(.+)\\1/mi", $this->textbox1, $matches ); if ( !empty( $matches[2] ) ) { global $wgParser; $this->summary = "/* " . @@ -1842,8 +1838,7 @@ END $baseText = $baseRevision->getText(); // The current state, we want to merge updates into it - $currentRevision = Revision::loadFromTitle( - $db, $this->mTitle ); + $currentRevision = Revision::loadFromTitle( $db, $this->mTitle ); if ( is_null( $currentRevision ) ) { wfProfileOut( $fname ); return false; -- 2.20.1