Skip to content

Commit adcc4db

Browse files
committed
gh-2433 replaces incorrect sprintf placeholders with default placeholders
1 parent 1ca7859 commit adcc4db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Slim/Http/UploadedFile.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function __construct($file, $name = null, $type = null, $size = null, $er
177177
public function getStream()
178178
{
179179
if ($this->moved) {
180-
throw new \RuntimeException(sprintf('Uploaded file %1s has already been moved', $this->name));
180+
throw new \RuntimeException(sprintf('Uploaded file %s has already been moved', $this->name));
181181
}
182182
if ($this->stream === null) {
183183
$this->stream = new Stream(fopen($this->file, 'r'));
@@ -233,22 +233,22 @@ public function moveTo($targetPath)
233233

234234
if ($targetIsStream) {
235235
if (!copy($this->file, $targetPath)) {
236-
throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath));
236+
throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath));
237237
}
238238
if (!unlink($this->file)) {
239-
throw new RuntimeException(sprintf('Error removing uploaded file %1s', $this->name));
239+
throw new RuntimeException(sprintf('Error removing uploaded file %s', $this->name));
240240
}
241241
} elseif ($this->sapi) {
242242
if (!is_uploaded_file($this->file)) {
243243
throw new RuntimeException(sprintf('%1s is not a valid uploaded file', $this->file));
244244
}
245245

246246
if (!move_uploaded_file($this->file, $targetPath)) {
247-
throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath));
247+
throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath));
248248
}
249249
} else {
250250
if (!rename($this->file, $targetPath)) {
251-
throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath));
251+
throw new RuntimeException(sprintf('Error moving uploaded file %s to %s', $this->name, $targetPath));
252252
}
253253
}
254254

0 commit comments

Comments
 (0)