Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Slim/Http/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ public function moveTo($targetPath)
throw new RuntimeException('Uploaded file already moved');
}

if (!is_writable(dirname($targetPath))) {
$targetIsStream = strpos($targetPath, '://') > 0;
if (!$targetIsStream && !is_writable(dirname($targetPath))) {
throw new InvalidArgumentException('Upload target path is not writable');
}

$targetIsStream = strpos($targetPath, '://') > 0;
if ($targetIsStream) {
if (!copy($this->file, $targetPath)) {
throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath));
Expand Down
3 changes: 0 additions & 3 deletions tests/Http/UploadedFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,6 @@ public function testMovedStream($uploadedFile)
$uploadedFile->getStream();
}

/**
* @expectedException \InvalidArgumentException
*/
public function testMoveToStream()
{
$uploadedFile = $this->generateNewTmpFile();
Expand Down