From 770cd0e059dacce59ce5a8dfc62c2c6a3d6bbde2 Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Tue, 27 Jul 2010 18:51:26 +0000 Subject: [PATCH] #851570 morningtime: Avoid trailing slashes when passing file paths to file_check_directory(). --- CHANGELOG.txt | 3 ++- includes/FeedsBatch.inc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a02516b4..9f60b54f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,7 +2,8 @@ Feeds 6.x 1.0 XXXXXXXXXXXXXXXXXX -------------------------------- - +- #851570 morningtime: Avoid trailing slashes when passing file paths to + file_check_directory(). - #836090 andrewlevine, alex_b: Include mapping configuration in hash. - #853156 alex_b: Support real updates of terms. - #858684 alex_b: Fix notices when file not found. diff --git a/includes/FeedsBatch.inc b/includes/FeedsBatch.inc index 1981205c..6d871aef 100644 --- a/includes/FeedsBatch.inc +++ b/includes/FeedsBatch.inc @@ -94,11 +94,11 @@ class FeedsImportBatch extends FeedsBatch { */ public function getFilePath() { if (!isset($this->file_path)) { - $dir = file_directory_path() .'/feeds/'; + $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) .'_'. drupal_get_token($this->url) .'_'. time(), FILE_EXISTS_RENAME); + $dest = file_destination($dir . '/' . get_class($this) .'_'. drupal_get_token($this->url) .'_'. time(), FILE_EXISTS_RENAME); $this->file_path = file_save_data($this->getRaw(), $dest); if($this->file_path === 0) { throw new Exception(t('Cannot write content to %dest', array('%dest' => $dest))); -- GitLab