diff --git a/plugins/FeedsFileFetcher.inc b/plugins/FeedsFileFetcher.inc index 0dc5f47e41207ed4ec444a8b139b965f318db086..6f1b3107628eff69f6af9ff67f8c7ac4051c68af 100644 --- a/plugins/FeedsFileFetcher.inc +++ b/plugins/FeedsFileFetcher.inc @@ -29,7 +29,7 @@ class FeedsFileFetcherResult extends FeedsFetcherResult { * Overrides parent::getFilePath(). */ public function getFilePath() { - if (!file_exists($this->file_path)) { + if (!is_readable($this->file_path)) { throw new Exception(t('File @filepath is not accessible.', array('@filepath' => $this->file_path))); } return $this->sanitizeFile($this->file_path); @@ -164,8 +164,8 @@ class FeedsFileFetcher extends FeedsFetcher { if (!$scheme || !in_array($scheme, $this->config['allowed_schemes'])) { form_set_error('feeds][FeedsFileFetcher][source', t("The file needs to reside within the site's files directory, its path needs to start with scheme://. Available schemes: @schemes.", array('@schemes' => implode(', ', $this->config['allowed_schemes'])))); } - // Check wether the given path exists. - elseif (!file_exists($values['source'])) { + // Check whether the given path is readable. + elseif (!is_readable($values['source'])) { form_set_error('feeds][FeedsFileFetcher][source', t('The specified file or directory does not exist.')); } }