tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

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

Open darrenbirks opened this issue 11 months ago • 2 comments

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 +

darrenbirks avatar Jan 20 '25 16:01 darrenbirks

Could a developer on this project comment on this?

darrenbirks avatar Jun 06 '25 15:06 darrenbirks

thanks for sharing, i'll check it out.

prasathmani avatar Jun 09 '25 12:06 prasathmani