var $autoSumm = '';
var $hookError = '';
var $mPreviewTemplates;
+ var $mBaseRevision = false;
# Form values
var $save = false, $preview = false, $diff = false;
$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;
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;
+ }
+ }
}