Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -62,6 +62,7 @@ |
63 | 63 | var $autoSumm = ''; |
64 | 64 | var $hookError = ''; |
65 | 65 | var $mPreviewTemplates; |
| 66 | + var $mBaseRevision = false; |
66 | 67 | |
67 | 68 | # Form values |
68 | 69 | var $save = false, $preview = false, $diff = false; |
— | — | @@ -1722,8 +1723,7 @@ |
1723 | 1724 | $db = wfGetDB( DB_MASTER ); |
1724 | 1725 | |
1725 | 1726 | // This is the revision the editor started from |
1726 | | - $baseRevision = Revision::loadFromTimestamp( |
1727 | | - $db, $this->mTitle, $this->edittime ); |
| 1727 | + $baseRevision = $this->getBaseRevision(); |
1728 | 1728 | if( is_null( $baseRevision ) ) { |
1729 | 1729 | wfProfileOut( $fname ); |
1730 | 1730 | return false; |
— | — | @@ -2332,4 +2332,15 @@ |
2333 | 2333 | return false; |
2334 | 2334 | } |
2335 | 2335 | } |
| 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 | + } |
2336 | 2347 | } |