Index: trunk/phase3/includes/Article.php |
— | — | @@ -942,9 +942,21 @@ |
943 | 943 | /** |
944 | 944 | * Side effects: loads last edit |
945 | 945 | */ |
946 | | - function getTextOfLastEditWithSectionReplacedOrAdded($section, $text, $summary = '') { |
947 | | - $this->loadLastEdit(); |
948 | | - $oldtext = $this->getContent( true ); |
| 946 | + function getTextOfLastEditWithSectionReplacedOrAdded($section, $text, $summary = '', $edittime = NULL) { |
| 947 | + if(is_null($edittime)) { |
| 948 | + $this->loadLastEdit(); |
| 949 | + $oldtext = $this->getContent( true ); |
| 950 | + } else { |
| 951 | + $dbw =& wfGetDB( DB_MASTER ); |
| 952 | + $ns = $this->mTitle->getNamespace(); |
| 953 | + $title = $this->mTitle->getDBkey(); |
| 954 | + $obj = $dbw->getArray( 'old', |
| 955 | + array( 'old_text','old_flags'), |
| 956 | + array( 'old_namespace' => $ns, 'old_title' => $title, |
| 957 | + 'old_timestamp' => $dbw->timestamp($edittime)), |
| 958 | + $fname ); |
| 959 | + $oldtext = Article::getRevisionText( $obj ); |
| 960 | + } |
949 | 961 | if ($section != '') { |
950 | 962 | if($section=='new') { |
951 | 963 | if($summary) $subject="== {$summary} ==\n\n"; |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -192,8 +192,14 @@ |
193 | 193 | } |
194 | 194 | $userid = $wgUser->getID(); |
195 | 195 | |
196 | | - $text = $this->mArticle->getTextOfLastEditWithSectionReplacedOrAdded( |
197 | | - $this->section, $this->textbox1, $this->summary); |
| 196 | + if ( $isConflict) { |
| 197 | + $text = $this->mArticle->getTextOfLastEditWithSectionReplacedOrAdded( |
| 198 | + $this->section, $this->textbox1, $this->summary, $this->edittime); |
| 199 | + } |
| 200 | + else { |
| 201 | + $text = $this->mArticle->getTextOfLastEditWithSectionReplacedOrAdded( |
| 202 | + $this->section, $this->textbox1, $this->summary); |
| 203 | + } |
198 | 204 | # Suppress edit conflict with self |
199 | 205 | |
200 | 206 | if ( ( 0 != $userid ) && ( $this->mArticle->getUser() == $userid ) ) { |