8000 Duplicated directory separator, and possible solution · Issue #8388 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Duplicated directory separator, and possible solution #8388
Closed
@disposable-ksa98

Description

@disposable-ksa98

I was testing a page to upload files, and logged the resulting file paths to see if it worked. I obtained the path like this:

$uploadDir = 'app/tmp/uploads/'
$file = $this->uploadedFile->move($uploadDir, $filename);
$file->getPathname();

The resulting path was something like this (notice the double slash): /path/to/app/tmp/uploads//myfile.tmp

I think the culprit might be this line: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/File/File.php#L140

Maybe you could do rtrim($directory, '/').

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0