Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: Replace incorrect sprintf placeholders with default placeholders #2466

Merged
merged 1 commit into from
Jul 15, 2018
Merged
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
10 changes: 5 additions & 5 deletions Slim/Http/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function __construct($file, $name = null, $type = null, $size = null, $er
public function getStream()
{
if ($this->moved) {
throw new \RuntimeException(sprintf('Uploaded file %1s has already been moved', $this->name));
throw new \RuntimeException(sprintf('Uploaded file %s has already been moved', $this->name));
}
if ($this->stream === null) {
$this->stream = new Stream(fopen($this->file, 'r'));
Expand Down Expand Up @@ -233,22 +233,22 @@ public function moveTo($targetPath)

if ($targetIsStream) {
if (!copy($this->file, $targetPath)) {
throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath));
throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath));
}
if (!unlink($this->file)) {
throw new RuntimeException(sprintf('Error removing uploaded file %1s', $this->name));
throw new RuntimeException(sprintf('Error removing uploaded file %s', $this->name));
}
} elseif ($this->sapi) {
if (!is_uploaded_file($this->file)) {
throw new RuntimeException(sprintf('%1s is not a valid uploaded file', $this->file));
}

if (!move_uploaded_file($this->file, $targetPath)) {
throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath));
throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath));
}
} else {
if (!rename($this->file, $targetPath)) {
throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath));
throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath));
}
}

Expand Down