Skip to content
Snippets Groups Projects
Commit 7a901696 authored by AdamPS's avatar AdamPS Committed by Chris Leppanen
Browse files

Issue #1982286 by AdamPS: Recoverable fatal error

parent 0f9f84c0
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ class FeedsFileFetcherResult extends FeedsFetcherResult { ...@@ -29,7 +29,7 @@ class FeedsFileFetcherResult extends FeedsFetcherResult {
* Overrides parent::getFilePath(). * Overrides parent::getFilePath().
*/ */
public function 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))); throw new Exception(t('File @filepath is not accessible.', array('@filepath' => $this->file_path)));
} }
return $this->sanitizeFile($this->file_path); return $this->sanitizeFile($this->file_path);
...@@ -164,8 +164,8 @@ class FeedsFileFetcher extends FeedsFetcher { ...@@ -164,8 +164,8 @@ class FeedsFileFetcher extends FeedsFetcher {
if (!$scheme || !in_array($scheme, $this->config['allowed_schemes'])) { 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'])))); 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. // Check whether the given path is readable.
elseif (!file_exists($values['source'])) { elseif (!is_readable($values['source'])) {
form_set_error('feeds][FeedsFileFetcher][source', t('The specified file or directory does not exist.')); form_set_error('feeds][FeedsFileFetcher][source', t('The specified file or directory does not exist.'));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment