r37680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37679‎ | r37680 | r37681 >
Date:08:43, 15 July 2008
Author:werdna
Status:old
Tags:
Comment:
Reintroduce some changes which were reverted for causing fatal errors.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -62,6 +62,7 @@
6363 var $autoSumm = '';
6464 var $hookError = '';
6565 var $mPreviewTemplates;
 66+ var $mBaseRevision = false;
6667
6768 # Form values
6869 var $save = false, $preview = false, $diff = false;
@@ -1722,8 +1723,7 @@
17231724 $db = wfGetDB( DB_MASTER );
17241725
17251726 // This is the revision the editor started from
1726 - $baseRevision = Revision::loadFromTimestamp(
1727 - $db, $this->mTitle, $this->edittime );
 1727+ $baseRevision = $this->getBaseRevision();
17281728 if( is_null( $baseRevision ) ) {
17291729 wfProfileOut( $fname );
17301730 return false;
@@ -2332,4 +2332,15 @@
23332333 return false;
23342334 }
23352335 }
 2336+
 2337+ function getBaseRevision() {
 2338+ if ($this->mBaseRevision == false) {
 2339+ $db = wfGetDB( DB_MASTER );
 2340+ $baseRevision = Revision::loadFromTimestamp(
 2341+ $db, $this->mTitle, $this->edittime );
 2342+ return $this->mBaseRevision = $baseRevision;
 2343+ } else {
 2344+ return $this->mBaseRevision;
 2345+ }
 2346+ }
23362347 }

Status & tagging log