From: Aaron Schulz Date: Thu, 9 Jan 2014 19:04:20 +0000 (-0800) Subject: Fixed file props test failure for MemoryFileBackend X-Git-Tag: 1.31.0-rc.0~17315^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=83cc94cd81e520baf063a89c20becc6d887f34f9;p=lhc%2Fweb%2Fwiklou.git Fixed file props test failure for MemoryFileBackend Change-Id: Ia593023569e3874e11598c38961a68a0da75883f --- diff --git a/includes/filebackend/MemoryFileBackend.php b/includes/filebackend/MemoryFileBackend.php index 3924c12e79..6f40957a6e 100644 --- a/includes/filebackend/MemoryFileBackend.php +++ b/includes/filebackend/MemoryFileBackend.php @@ -155,7 +155,9 @@ class MemoryFileBackend extends FileBackendStore { if ( $src === null || !isset( $this->files[$src] ) ) { $fsFile = null; } else { - $fsFile = TempFSFile::factory( 'localcopy_' ); + // Create a new temporary file with the same extension... + $ext = FileBackend::extensionFromPath( $src ); + $fsFile = TempFSFile::factory( 'localcopy_', $ext ); if ( $fsFile ) { $bytes = file_put_contents( $fsFile->getPath(), $this->files[$src]['data'] ); if ( $bytes !== strlen( $this->files[$src]['data'] ) ) {