r45809 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45808‎ | r45809 | r45810 >
Date:19:56, 16 January 2009
Author:aaron
Status:ok
Tags:
Comment:
(bug 1181) Don't try to replace the whole page with one section if replaceSection() fails
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -918,10 +918,8 @@
919919 if ( is_null( $text ) ) {
920920 wfDebug( "EditPage::editForm activating conflict; section replace failed.\n" );
921921 $this->isConflict = true;
922 - $text = $this->textbox1;
923 - }
924 -
925 - if ( $this->isConflict ) {
 922+ $text = $this->textbox1; // do not try to merge here!
 923+ } else if ( $this->isConflict ) {
926924 # Attempt merge
927925 if ( $this->mergeChangesInto( $text ) ) {
928926 // Successful merge! Maybe we should tell the user the good news?
@@ -1149,9 +1147,7 @@
11501148 if ( $this->section != '' && $this->section != 'new' ) {
11511149 $matches = array();
11521150 if ( !$this->summary && !$this->preview && !$this->diff ) {
1153 - preg_match( "/^(=+)(.+)\\1/mi",
1154 - $this->textbox1,
1155 - $matches );
 1151+ preg_match( "/^(=+)(.+)\\1/mi", $this->textbox1, $matches );
11561152 if ( !empty( $matches[2] ) ) {
11571153 global $wgParser;
11581154 $this->summary = "/* " .
@@ -1842,8 +1838,7 @@
18431839 $baseText = $baseRevision->getText();
18441840
18451841 // The current state, we want to merge updates into it
1846 - $currentRevision = Revision::loadFromTitle(
1847 - $db, $this->mTitle );
 1842+ $currentRevision = Revision::loadFromTitle( $db, $this->mTitle );
18481843 if ( is_null( $currentRevision ) ) {
18491844 wfProfileOut( $fname );
18501845 return false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r42037Improve hidden field checks for bug 1181aaron15:40, 13 October 2008
r42569Revert r42037 "Improve hidden field checks for bug 1181"...brion20:09, 25 October 2008

Status & tagging log