Closed (fixed)
Project:
Remote Stream Wrapper
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2013 at 01:18 UTC
Updated:
6 May 2014 at 04:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
zhangtaihao commentedHere's a patch that gets around the problem by simply stripping the query string (since this module does not add the token anyway).
I presume if we want to follow Drupal core 7.20 we will have to do it at some point.
Comment #2
miroslavbanov commentedThe bug is reproduced. My setup is: two drupal 7.20 sites, one site adding external image from the other site to its media field. When I choose an image style for format settings of the media field, the styled image does not display, and the token part of the image path is URL-encoded, resulting in image path that ends with %3Fitok%3Dxxxxxxxx.
Successfully applied the patch in #1, which fixed my issues.
Comment #3
samalone commentedPatch #1 fixes the problem with remote images, but breaks local ones. That is, it fixes URLs like:
public://styles/lead_photo/http/www.cdc.gov/flu/images/influenza-virus-fulltext.jpg?itok=hyHOSHnrbut breaks ones like:
http://lbn.local/sites/default/files/styles/large_lead_photo/public/What%20I%20have%202.jpg?itok=QjirsHjPI adapted patch #1 to only modify public URLs, but have no idea if that's right or just happens to work in my case.
Comment #4
zhangtaihao commentedSilly me. Okay the patch has been updated to just match the regular expression and strip token only if remote.
Comment #5
pstewart commentedAnother reporduction of this bug confirmed. I was able to use patch from #4 to fix the query string problem, which allowed images which were previously working to work again. However, it also seemed to trigger further issues with 7.20 stopping image derivatives from working on all new images (it is unclear whether it was the patch itself or whether it was something else in the module, as I applied the patch against a git clone of the current tree). Using the 'image_allow_insecure_derivatives' variable has mitigated the problem for now.
I plan to roll out 7.21 over the weekend, and will confirm whether or not this works with 'image_allow_insecure_derivatives' switched off.
Comment #6
darren ohI have moved processing to hook_file_url_alter() so the query string will work as intended.
Comment #7
darren ohThe test bot will not test this patch because the project currently does not pass its own tests. However, all tests passed on my local machine with this patch applied.
Comment #8
pianomansam commentedI also had this issue and patch in #6 fixed it for me. I think it's time to mark this as RTBC.
Comment #9
summit commentedHi, Yes commit this please!
Greetings, Martijn
Comment #10
danielnolde commentedI experienced the problem as well (http://...jpg image url via remote stream wrapper in media field whose display settings are configured to output image with imagestyle, outputted url broken), but the patch in #6 doesn't seem to help.
Comment #11
amaisano commented#6 worked for me and I was using the 1.x beta4 version. Thanks!
Comment #12
dave reidThanks everyone, committed to 7.x-1.x.
Comment #17
dave reid