From: Andrew Garrett Date: Tue, 15 Jul 2008 08:43:40 +0000 (+0000) Subject: Reintroduce some changes which were reverted for causing fatal errors. X-Git-Tag: 1.31.0-rc.0~46507 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=2051ba1a18b1beecb6821d865a332306b24d3c44;p=lhc%2Fweb%2Fwiklou.git Reintroduce some changes which were reverted for causing fatal errors. --- 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; + } + } }