Skip to content

Commit

Permalink
Merge pull request #2123 from lucifergit/patch-2
Browse files Browse the repository at this point in the history
WIP fix store() default value bug
  • Loading branch information
lonnieezell authored Oct 17, 2019
2 parents 345caa3 + 5be9a5c commit baaefe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/HTTP/Files/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ public function isValid(): bool
*/
public function store(string $folderName = null, string $fileName = null): string
{
$folderName = $folderName ?? date('Ymd');
$folderName = rtrim($folderName ?? date('Ymd'), '/') . '/' ;
$fileName = $fileName ?? $this->getRandomName();

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

//--------------------------------------------------------------------
Expand Down

0 comments on commit baaefe7

Please sign in to comment.