X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryDeletedrevs.php;h=83d00a933015ea07686a2078a702be6af6ff8c6a;hb=bb8c060128a79532e1b6885fb3ebd6174d3f4d4d;hp=2d5074178ef6f1543c366d98b22ceefa5128572a;hpb=dcee65673b531ebe39a093ee0c021a926ea74ad9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 2d5074178e..83d00a9330 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -144,17 +144,11 @@ class ApiQueryDeletedrevs extends ApiQueryBase { } if ( $fld_content ) { - // Modern MediaWiki has the content for deleted revs in the 'text' - // table using fields old_text and old_flags. But revisions deleted - // pre-1.5 store the content in the 'archive' table directly using - // fields ar_text and ar_flags, and no corresponding 'text' row. So - // we have to LEFT JOIN and fetch all four fields, plus ar_text_id - // to be able to tell the difference. $this->addTables( 'text' ); $this->addJoinConds( [ 'text' => [ 'LEFT JOIN', [ 'ar_text_id=old_id' ] ] ] ); - $this->addFields( [ 'ar_text', 'ar_flags', 'ar_text_id', 'old_text', 'old_flags' ] ); + $this->addFields( [ 'ar_text_id', 'old_text', 'old_flags' ] ); // This also means stricter restrictions $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] ); @@ -370,12 +364,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { $anyHidden = true; } if ( Revision::userCanBitfield( $row->ar_deleted, Revision::DELETED_TEXT, $user ) ) { - if ( isset( $row->ar_text ) && !$row->ar_text_id ) { - // Pre-1.5 ar_text row (if condition from Revision::newFromArchiveRow) - ApiResult::setContentValue( $rev, 'text', Revision::getRevisionText( $row, 'ar_' ) ); - } else { - ApiResult::setContentValue( $rev, 'text', Revision::getRevisionText( $row ) ); - } + ApiResult::setContentValue( $rev, 'text', Revision::getRevisionText( $row ) ); } }