From: Tim Starling Date: Wed, 3 Aug 2005 09:14:31 +0000 (+0000) Subject: Fixed display of most recent revision X-Git-Tag: 1.6.0~2066 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=a18ad57168c2942d665f1af4f1cf6e4cc7c760ca;p=lhc%2Fweb%2Fwiklou.git Fixed display of most recent revision --- diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index eb73ff39b9..47fa8618f2 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -83,12 +83,20 @@ class PageArchive { 'ar_title' => $this->title->getDbkey(), 'ar_timestamp' => $dbr->timestamp( $timestamp ) ), $fname ); + return $this->getTextFromRow( $row ); + } + + /** + * Get the text from an archive row containing ar_text, ar_flags and ar_text_id + */ + function getTextFromRow( $row ) { if( is_null( $row->ar_text_id ) ) { // An old row from MediaWiki 1.4 or previous. // Text is embedded in this row in classic compression format. return Revision::getRevisionText( $row, "ar_" ); } else { // New-style: keyed to the text storage backend. + $dbr =& wfGetDB( DB_SLAVE ); $text = $dbr->selectRow( 'text', array( 'old_text', 'old_flags' ), array( 'old_id' => $row->ar_text_id ), @@ -96,6 +104,7 @@ class PageArchive { return Revision::getRevisionText( $text ); } } + /** * Fetch (and decompress if necessary) the stored text of the most @@ -108,13 +117,13 @@ class PageArchive { function getLastRevisionText() { $dbr =& wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'archive', - array( 'ar_text', 'ar_flags' ), + array( 'ar_text', 'ar_flags', 'ar_text_id' ), array( 'ar_namespace' => $this->title->getNamespace(), 'ar_title' => $this->title->getDBkey() ), 'PageArchive::getLastRevisionText', array( 'ORDER BY' => 'ar_timestamp DESC' ) ); if( $row ) { - return Revision::getRevisionText( $row, "ar_" ); + return $this->getTextFromRow( $row ); } else { return NULL; }