From 2051ba1a18b1beecb6821d865a332306b24d3c44 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Tue, 15 Jul 2008 08:43:40 +0000 Subject: [PATCH] Reintroduce some changes which were reverted for causing fatal errors. --- includes/EditPage.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 98ab49f27f..0dfe42164f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -62,6 +62,7 @@ class EditPage { var $autoSumm = ''; var $hookError = ''; var $mPreviewTemplates; + var $mBaseRevision = false; # Form values var $save = false, $preview = false, $diff = false; @@ -1722,8 +1723,7 @@ END $db = wfGetDB( DB_MASTER ); // This is the revision the editor started from - $baseRevision = Revision::loadFromTimestamp( - $db, $this->mTitle, $this->edittime ); + $baseRevision = $this->getBaseRevision(); if( is_null( $baseRevision ) ) { wfProfileOut( $fname ); return false; @@ -2332,4 +2332,15 @@ END return false; } } + + function getBaseRevision() { + if ($this->mBaseRevision == false) { + $db = wfGetDB( DB_MASTER ); + $baseRevision = Revision::loadFromTimestamp( + $db, $this->mTitle, $this->edittime ); + return $this->mBaseRevision = $baseRevision; + } else { + return $this->mBaseRevision; + } + } } -- 2.20.1