From ce90da394ef72b3d750f6e2a8046b60af78a59dc Mon Sep 17 00:00:00 2001 From: overtrue Date: Sat, 16 Apr 2016 13:00:42 +0800 Subject: [PATCH] Bugfix close #389 (#391) * Bugfix close #389 * Fix tests. --- src/Material/Temporary.php | 6 +++--- tests/Material/MaterialTemporaryTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Material/Temporary.php b/src/Material/Temporary.php index 46887f5f3..c6e31c867 100644 --- a/src/Material/Temporary.php +++ b/src/Material/Temporary.php @@ -60,11 +60,11 @@ public function download($mediaId, $directory, $filename = '') $stream = $this->getStream($mediaId); - $ext = File::getStreamExt($stream); + $filename .= File::getStreamExt($stream); - file_put_contents($directory.'/'.$filename.'.'.$ext, $stream); + file_put_contents($directory.'/'.$filename, $stream); - return $filename.'.'.$ext; + return $filename; } /** diff --git a/tests/Material/MaterialTemporaryTest.php b/tests/Material/MaterialTemporaryTest.php index 872d935a1..63c5b1f9e 100755 --- a/tests/Material/MaterialTemporaryTest.php +++ b/tests/Material/MaterialTemporaryTest.php @@ -124,7 +124,7 @@ class File { public static function getStreamExt() { - return 'jpg'; + return '.jpg'; } } }