Skip to content
Snippets Groups Projects
Commit ea0e005b authored by Alex Barth's avatar Alex Barth
Browse files

#725392 nicholasThompson: FeedsBatch does not check feeds folder exists before uploading.

parent 83fd59dc
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
Feeds 6.x 1.0 xxxxxxxxxxxxxxxxxxxx Feeds 6.x 1.0 xxxxxxxxxxxxxxxxxxxx
---------------------------------- ----------------------------------
- #725392 nicholasThompson: FeedsBatch does not check feeds folder exists before
uploading.
- #776972 lyricnz: Messages use plural when describing single item. - #776972 lyricnz: Messages use plural when describing single item.
- #701390 frega, morningtime, Mixologic, alex_b et. al.: Fix RSS 1.0 parsing - #701390 frega, morningtime, Mixologic, alex_b et. al.: Fix RSS 1.0 parsing
and add basic test framework for common_syndication_parser. and add basic test framework for common_syndication_parser.
......
...@@ -89,7 +89,11 @@ class FeedsImportBatch extends FeedsBatch { ...@@ -89,7 +89,11 @@ class FeedsImportBatch extends FeedsBatch {
*/ */
public function getFilePath() { public function getFilePath() {
if (!isset($this->file_path)) { if (!isset($this->file_path)) {
$dest = file_destination(file_directory_path() .'/feeds/'. get_class($this) .'_'. md5($this->url) .'_'. time(), FILE_EXISTS_RENAME); $dir = file_directory_path() .'/feeds/';
if (!file_check_directory($dir, TRUE)) {
throw new Exception(t('Feeds directory either cannot be created or is not writable.'));
}
$dest = file_destination($dir . get_class($this) .'_'. md5($this->url) .'_'. time(), FILE_EXISTS_RENAME);
$this->file_path = file_save_data($this->getRaw(), $dest); $this->file_path = file_save_data($this->getRaw(), $dest);
if($this->file_path === 0) { if($this->file_path === 0) {
throw new Exception(t('Cannot write content to %dest', array('%dest' => $dest))); throw new Exception(t('Cannot write content to %dest', array('%dest' => $dest)));
......
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