From 4e0df84d476b9ab6feda82ebb0af97299bad0e3d Mon Sep 17 00:00:00 2001 From: young hahn <yhahn@264833.no-reply.drupal.org> Date: Fri, 29 Oct 2010 20:05:16 +0000 Subject: [PATCH] Throw exception if file is not writable for BOM sanitization. --- plugins/FeedsFetcher.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/FeedsFetcher.inc b/plugins/FeedsFetcher.inc index 78ca66b8..f8e29559 100644 --- a/plugins/FeedsFetcher.inc +++ b/plugins/FeedsFetcher.inc @@ -93,7 +93,10 @@ class FeedsFetcherResult extends FeedsResult { if (substr($line, 0,3) == pack('CCC',0xef,0xbb,0xbf)) { $contents = file_get_contents($filepath); $contents = substr($contents, 3); - file_put_contents($filepath, $contents); + $status = file_put_contents($filepath, $contents); + if ($status === FALSE) { + throw new Exception(t('File @filepath is not writeable.', array('@filepath' => $filepath))); + } } return $filepath; } -- GitLab