Closed (works as designed)
Project:
Insert
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 May 2013 at 02:25 UTC
Updated:
17 Jul 2017 at 16:25 UTC
Jump to comment: Most recent
Comments
Comment #1
quicksketchThis patch definitely does not feel very safe. It seems very strange that you would be saying, "if this is a local file, but the URL is remote, then remove the domain". Of course the situation that the file would be local and the URL be remote is strange in itself, but I suppose that's the way CDN module operates. I'm not very comfortable with this patch on the whole. Even with additional documentation around these calls, it's introducing some pretty messy situational code that seems like it could have unexpected results.
Comment #2
ttkaminski commentedI agree that there may be some fringe cases where this patch may cause problems, but I can't think of any specific examples ATM. The drupal function
file_create_urldoes not accept any argument for requesting a local (relative url). I think this would be the best approach:$url = file_create_url($uri, array("absolute" => FALSE));, but this would involve first patching the core.In the meantime, I've been using the above patch in production for a few days without any noticeable problems. I wouldn't feel bad if it wasn't merged in, but it's definitely useful for people who need it.
Comment #3
richsky commentedCould it be the same with Domain Access, it seems to be the case.
Comment #4
snater commentedSeems to have a solution at https://www.drupal.org/node/1863530