The FeedsFileFetcher class implements a method, listFiles to list all the files to fetch. However, this method does not take into consideration the allowed extensions set in the Fetcher configuration. This leads to attempts to import the wrongs files.

Attached is a patch that makes two major changes. One is to ensure that only files with the correction extension are fetched. This is done by a means of the second major change, which is to swap out normal PHP file scanning techniques with Drupal techniques instead. In this instance, this means using file_scan_directory which also reduces code. Refactor++.

CommentFileSizeAuthor
feeds-7.x-FeedsFileFetcher.patch1018 bytesJosh Waihi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

twistor’s picture

Status: Active » Needs review

This looks good.

  • MegaChriz committed b0c868c on 7.x-2.x authored by Josh Waihi
    Issue #2309471 by Josh Waihi: File Fetcher doesn't obey allowed...
MegaChriz’s picture

Status: Needs review » Fixed

Tested manually. Works fine. Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

qpro’s picture

After experimenting this issue https://www.drupal.org/node/2116467 and to realize that the problem was that "Allowed file extensions" (in "File upload Settings") is case sensitive, I think that the "case-sensitivism" should be the same in all upload modules.

I don't realize about the problem before perhaps due to I was using media module in the same site to upload same files and I was not experiencing any problem (media module is case insensitive)