From: umherirrender Date: Sat, 10 Sep 2016 20:36:50 +0000 (+0200) Subject: Use Database::timestamp in LocalFile::loadFieldsWithTimestamp X-Git-Tag: 1.31.0-rc.0~5669^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=1bc2b88bb2021eca3fc25b61297a08e058dafb77;p=lhc%2Fweb%2Fwiklou.git Use Database::timestamp in LocalFile::loadFieldsWithTimestamp Postgres needs a special timestamp format on sql which is handled by Database::timestamp. Bug: T145066 Change-Id: I8db958ecbea7c12af8caf8354490e59500975e4b --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index de3cdbeed3..d63a91b6a2 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -431,16 +431,18 @@ class LocalFile extends File { private function loadFieldsWithTimestamp( $dbr, $fname ) { $fieldMap = false; - $row = $dbr->selectRow( 'image', $this->getLazyCacheFields( 'img_' ), - [ 'img_name' => $this->getName(), 'img_timestamp' => $this->getTimestamp() ], - $fname ); + $row = $dbr->selectRow( 'image', $this->getLazyCacheFields( 'img_' ), [ + 'img_name' => $this->getName(), + 'img_timestamp' => $dbr->timestamp( $this->getTimestamp() ) + ], $fname ); if ( $row ) { $fieldMap = $this->unprefixRow( $row, 'img_' ); } else { # File may have been uploaded over in the meantime; check the old versions - $row = $dbr->selectRow( 'oldimage', $this->getLazyCacheFields( 'oi_' ), - [ 'oi_name' => $this->getName(), 'oi_timestamp' => $this->getTimestamp() ], - $fname ); + $row = $dbr->selectRow( 'oldimage', $this->getLazyCacheFields( 'oi_' ), [ + 'oi_name' => $this->getName(), + 'oi_timestamp' => $dbr->timestamp( $this->getTimestamp() ) + ], $fname ); if ( $row ) { $fieldMap = $this->unprefixRow( $row, 'oi_' ); }