Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
darrenbirks opened this issue Jan 20, 2025 · 0 comments

Comments

@darrenbirks
Copy link

darrenbirks commented Jan 20, 2025

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 +

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant