public function deletedLink( $id ) {
if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
$dbr = wfGetDB( DB_REPLICA );
- $row = $dbr->selectRow( 'archive', '*',
+ $row = $dbr->selectRow( 'archive',
+ Revision::selectArchiveFields(),
[ 'ar_rev_id' => $id ],
__METHOD__ );
if ( $row ) {
if ( $this->historyLine == 0 ) { // called for the first time, return line from cur
$this->historyRes = $dbr->select( 'image',
- [
- '*',
- "'' AS oi_archive_name",
- '0 as oi_deleted',
- 'img_sha1'
+ self::selectFields() + [
+ 'oi_archive_name' => $dbr->addQuotes( '' ),
+ 'oi_deleted' => 0,
],
[ 'img_name' => $this->title->getDBkey() ],
$fname
return false;
}
} elseif ( $this->historyLine == 1 ) {
- $this->historyRes = $dbr->select( 'oldimage', '*',
+ $this->historyRes = $dbr->select(
+ 'oldimage',
+ OldLocalFile::selectFields(),
[ 'oi_name' => $this->title->getDBkey() ],
$fname,
[ 'ORDER BY' => 'oi_timestamp DESC' ]