Skip to content
Snippets Groups Projects
Commit 4e0df84d authored by young hahn's avatar young hahn
Browse files

Throw exception if file is not writable for BOM sanitization.

parent 998b1ed8
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,10 @@ class FeedsFetcherResult extends FeedsResult { ...@@ -93,7 +93,10 @@ class FeedsFetcherResult extends FeedsResult {
if (substr($line, 0,3) == pack('CCC',0xef,0xbb,0xbf)) { if (substr($line, 0,3) == pack('CCC',0xef,0xbb,0xbf)) {
$contents = file_get_contents($filepath); $contents = file_get_contents($filepath);
$contents = substr($contents, 3); $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; return $filepath;
} }
......
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