Skip to content

Commit baaefe7

Browse files
authored
Merge pull request #2123 from lucifergit/patch-2
WIP fix store() default value bug
2 parents 345caa3 + 5be9a5c commit baaefe7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

system/HTTP/Files/UploadedFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,12 @@ public function isValid(): bool
400400
*/
401401
public function store(string $folderName = null, string $fileName = null): string
402402
{
403-
$folderName = $folderName ?? date('Ymd');
403+
$folderName = rtrim($folderName ?? date('Ymd'), '/') . '/' ;
404404
$fileName = $fileName ?? $this->getRandomName();
405405

406406
// Move the uploaded file to a new location.
407407
return ($this->move(WRITEPATH . 'uploads/' . $folderName, $fileName)) ?
408-
$folderName . DIRECTORY_SEPARATOR . $this->name : null;
408+
$folderName . $this->name : null;
409409
}
410410

411411
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)