X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FLocalFile.php;h=4c0dea246e9a9352bad1d8d63a258ed0f7a973f4;hp=8aea7abadef40298a1a1597f1e4f68af8d12dfa4;hb=ab4e6fdd516ee51ee20235cdedd67a777cc5d018;hpb=62a9ee2f45e43d3a5dc3564334c210fa1e3ad298 diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 8aea7abade..4c0dea246e 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -351,9 +351,8 @@ class LocalFile extends File { static $results = []; if ( $prefix == '' ) { - return $fields; + return array_merge( $fields, [ 'description' ] ); } - if ( !isset( $results[$prefix] ) ) { $prefixedFields = []; foreach ( $fields as $field ) { @@ -1129,11 +1128,9 @@ class LocalFile extends File { 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 @@ -1145,7 +1142,9 @@ class LocalFile extends File { 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' ]