From 5c129e17e5f69fa23ddfc5eb7127c2ad1414aad3 Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Mon, 18 Jan 2010 20:05:53 +0000 Subject: [PATCH] Throw appropriate errors. Add an @ to suppress debug output when SimpleXMLElement constructor encounters problem. Output exception message (on FeedsSource level) instead. --- libraries/opml_parser.inc | 3 +-- plugins/FeedsFileFetcher.inc | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/opml_parser.inc b/libraries/opml_parser.inc index de0f9df2..b3d1989b 100644 --- a/libraries/opml_parser.inc +++ b/libraries/opml_parser.inc @@ -16,8 +16,7 @@ */ function opml_parser_parse($raw) { $feeds = $items = array(); - $xml = new SimpleXMLElement($raw); - + $xml = @ new SimpleXMLElement($raw); $feeds['title'] = (string)current($xml->xpath('//head/title')); // @todo Make xpath case insensitive. diff --git a/plugins/FeedsFileFetcher.inc b/plugins/FeedsFileFetcher.inc index 85507dce..951fa81c 100644 --- a/plugins/FeedsFileFetcher.inc +++ b/plugins/FeedsFileFetcher.inc @@ -16,8 +16,6 @@ class FeedsFileFetcher extends FeedsFetcher { */ public function fetch(FeedsSource $source) { $source_config = $source->getConfigFor($this); - // Just return path to file, contents can be read easily with - // file_get_contents($file_path); return new FeedsImportBatch(NULL, $source_config['source']); } -- GitLab