We are using private browsing, filesystem and web page encoding: UTF-8
The problem occured ONLY if filename start special Hungarian characters: é, É, á, Á, ű, Ű, ő, Ő, ú, Ú, ó, Ó, ü, Ü, ö, Ö, í, Í. These characters appear in the browser well.
I get access denied, when trying download file.
Please help.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | filebrowser.module.patch | 1.63 KB | Gozi |
| #2 | filebrowser.module.patch | 1.63 KB | Gozi |
Comments
Comment #1
Breakerandi commentedI Have also problems with special characters. The File can not be downloaded because of a wrong address
Comment #2
Gozi commentedI found the reason of the problem: that standard PHP function basename() is not safe. If filenames start with non-latin characters: all of them had been stripping.
chx ( http://drupal.org/user/9446 ) has created a replacement for basename().
Code is:
More info: http://drupal.org/node/278425
Patch for 6.x-2.x-dev version only!
Comment #3
Gozi commentedCorrected and updated patch.
Comment #4
Gozi commentedThe early pasted and linked chx's safe baseneme function (http://drupal.org/node/278425) not fully compatible the original basename. I wrote own UTF-8 safe basename function, that works great with filebrowser.module.
If you applied previous patch, replace filebrowser_basename function with this.
Comment #5
Yoran commentedThank you for this ! I added your last function and it works perfectly. It's in dev now.