* (bug 3806) Gracefully fall back to client-side scaling on |thumb| image
that passes $wgMaxImageArea
* MySQL 5.0 strict mode fix for moving unwatched pages
-
+* (bug 3816) Throw edit conflict instead of fatal error when a page is
+ moved or deleted during section edit
=== Caveats ===
$this->replaceSection( $section, $text, $summary, $edittime );
}
+ /**
+ * @return string Complete article text, or null if error
+ */
function replaceSection($section, $text, $summary = '', $edittime = NULL) {
$fname = 'Article::replaceSection';
wfProfileIn( $fname );
$dbw =& wfGetDB( DB_MASTER );
$rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime );
}
+ if( is_null( $rev ) ) {
+ wfDebug( "Article::replaceSection asked for bogus section (page: " .
+ $this->getId() . "; section: $section; edittime: $edittime)\n" );
+ return null;
+ }
$oldtext = $rev->getText();
if($section=='new') {
wfDebug( "EditPage::editForm getting section '$this->section'\n" );
$text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $this->summary);
}
+ if( is_null( $text ) ) {
+ wfDebug( "EditPage::editForm activating conflict; section replace failed.\n" );
+ $this->isConflict = true;
+ $text = $this->textbox1;
+ }
# Suppress edit conflict with self, except for section edits where merging is required.
if ( ( $this->section == '' ) && ( 0 != $userid ) && ( $this->mArticle->getUser() == $userid ) ) {