Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
file system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2007 at 14:56 UTC
Updated:
16 Aug 2008 at 11:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
Steven commentedThis need proper urlencoding.
Comment #2
soxofaan commentedThat was also my first thought but the problem is that the slash ('/') in
images/800_werk%20035.jpgwill also be encoded, which is not desired. I guess you need to explode the path on '/' first, urlencode each part and implode again. This is probably a lot of overhead for just coping with a corner case?Comment #3
soxofaan commentedThis patch uses drupal_urlencode() instead of the hackish str_replace() of my original patch.
No problem with "/" characters in the path.
Comment #4
drummThis would double-encode the path when using the private file download method, since url() does that for us.
Comment #5
soxofaan commentedmoved it inside the FILE_DOWNLOADS_PUBLIC case branch:
At #4 where version was changed from 5.x-def to 6.x dev:
shouldn't this also be fixed in D5?
Comment #6
toeofdestiny commentedI have the same problem here, and here is my patch.
It is almost the same as the already submitted one, except that I "rawurlencode" the path because the paths containing '+' weren't working on my server for some reason.
Comment #7
drewish commentedsee #140238: can't access files with percents in filenames
Comment #8
drewish commentedactually this has a patch so i'll mark it as active instead. it'd need to be applied to 7 and then backported as a bug fix.
Comment #9
soxofaan commentedreroll for HEAD
Comment #10
soxofaan commentedreroll for the new Drupal coding standard about string concatenation I just learned about ;)
Comment #11
Freso commentedAdding to my issue queue.
Comment #12
bjaspan commentedSubscribe. It looks like my issue http://drupal.org/node/238299 may be a duplicate of this one.
Comment #13
Freso commented@bjaspan: That sounds very likely. Could you perhaps try the patch and see if it fixes the problem on your end?
Comment #14
c960657 commentedUsing drupal_urlencode() wont work for filenames containing # or & when clean_url's are enabled. I suggest using
str_replace('%2F', '/', rawurlencode($prefix . $path))instead (the same approach is used inside drupal_urlencode()).See also the patch in #207310: Allow rewriting of file URL's using custom_url_rewrite_outbound().
Comment #15
c960657 commentedClosing as duplicate of #238299: file_create_url should return valid URLs. That bug has a patch (pending review) and a unit test.
Comment #16
c960657 commented