From: Aaron Schulz Date: Sun, 22 Jan 2012 03:25:19 +0000 (+0000) Subject: Simplified last_modified timestamp conversion in SwiftFileBackend to just use wfTimes... X-Git-Tag: 1.31.0-rc.0~25135 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22calendrier%22%2C%22type=semaine%22%29%20.%20%22?a=commitdiff_plain;h=76fc292ac856f857f2115592b8cccc9baff4d54e;p=lhc%2Fweb%2Fwiklou.git Simplified last_modified timestamp conversion in SwiftFileBackend to just use wfTimestamp() --- diff --git a/includes/filerepo/backend/SwiftFileBackend.php b/includes/filerepo/backend/SwiftFileBackend.php index 197236a553..a9427f0992 100644 --- a/includes/filerepo/backend/SwiftFileBackend.php +++ b/includes/filerepo/backend/SwiftFileBackend.php @@ -440,17 +440,12 @@ class SwiftFileBackend extends FileBackend { try { $contObj = $this->getContainer( $srcCont ); $srcObj = $contObj->get_object( $srcRel, $this->headersFromParams( $params ) ); - // Convert dates like "Tue, 03 Jan 2012 22:01:04 GMT" to TS_MW - $date = DateTime::createFromFormat( 'D, d F Y G:i:s e', $srcObj->last_modified ); - if ( $date ) { - $stat = array( - 'mtime' => $date->format( 'YmdHis' ), - 'size' => $srcObj->content_length, - 'sha1' => $srcObj->metadata['Sha1base36'] - ); - } else { // exception will be caught below - throw new Exception( "Could not parse date for object {$srcRel}" ); - } + $stat = array( + // Convert dates like "Tue, 03 Jan 2012 22:01:04 GMT" to TS_MW + 'mtime' => wfTimestamp( TS_MW, $srcObj->last_modified ), + 'size' => $srcObj->content_length, + 'sha1' => $srcObj->metadata['Sha1base36'] + ); } catch ( NoSuchContainerException $e ) { } catch ( NoSuchObjectException $e ) { } catch ( InvalidResponseException $e ) {