Closed (outdated)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2015 at 06:43 UTC
Updated:
9 Feb 2026 at 19:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anas_maw commentedThis patch solve this issue.
Comment #3
anas_maw commentedComment #4
anas_maw commentedChanging patch name to match comment number.
Comment #5
twistor commentedDoes appending the base_url actually make sense to do here?
Comment #6
megachrizThe last major change to this file happened to be on Feeds 6.x-1.0-alpha1 (!), back in October 2009. I wonder why the source is get from the config array and not from the "source" database column. I think this was probably logical to do for Drupal 6 as I think the file fetcher url didn't start with "public://" or "private://" back then?
And no, it doesn't look like appending the base url makes any sense here, since the source for the file fetcher is usually something like this:
So that would result into
This needs work. The source should probably be taken from the source column. I think the handler should check if the source value looks like an url. If so, it should format it as such or else just return the value as is (but still sanitize it, of course).
Comment #7
jesss commentedI just ran into this issue. The fix is actually fairly simple, since the importer requires that files be in either the public:// or private:// wrapper. We just need to run it through
file_create_url().Comment #8
megachrizAre you sure that the code needs to check for 'feeds_source' here? Can this feature be backed up with an automated test?
Comment #9
jesss commentedAh, whoops.
feeds_sourcedoesn't exist. It should be checking forsourceinstead. Updated patch attached.Comment #10
megachrizI've tested the patch in #9 and I found out that
check_plain()isn't needed.file_create_url()already sanitizes the data. Tested with the following sources:public://feeds/content.csvbecomeshttp://www.example.com/sites/default/files/feeds/content.csvpublic://feeds/content>.csvbecomeshttp://www.example.com/sites/default/files/feeds/content%3E.csvpublic://feeds/content<script>alert("hello")</script>.csvbecomeshttp://www.example.com/sites/default/files/feeds/content%3Cscript%3Ealert%28%22hello%22%29%3C/script%3E.csvIdeally though, it would take the source value from the source column instead of from config. Now it only works for two specific fetchers. But I guess this is second best.
Comment #11
jesss commentedThe patch in #10 works for me.
Comment #12
megachrizThanks for testing, @jesss. I have committed the patch from #10.
I'll leave this issue open for these two reasons:
Comment #14
bluegeek9 commentedDrupal 7 reached end of life and the D7 version of Feeds is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues.
If you still have questions about using Feeds on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #feeds channel on Drupal Slack.
If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome!
Comment #15
bluegeek9 commented