Skip to content

Filenames with a + give File Not Found Error due to use of urlencode/urldecode instead of rawurlencode/rawurldecode #1271

@darrenbirks

Description

@darrenbirks

Attempting to download a file that contains a + in it does not work, and failed with a 'File Not Found' error.

This appears to be due to the filename been passed back to the php script on the query string after been passed through urlencode() and the script receiving it and decoding it with urldecode()

With this, spaces get encoded as + and a + gets decoded back to a space.

If the original string (filename) actually contained a +, this gets incorrectly converted to a space by urldecode, causing it not to find the file on the disk.

We should be using rawurlencode and rawurldecode instead to comply with RFC 3986. This would encode spaces correctly as %20
and not mishandle the +

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions