Skip to content
Snippets Groups Projects
Commit ed6cfa80 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Issue #1485870 by brad.bulger, twistor: Remove custom error reporting for SimplePie.

parent b0108a65
No related branches found
No related tags found
No related merge requests found
......@@ -966,15 +966,9 @@ function feeds_plugin($plugin, $id) {
*/
function feeds_include_library($file, $library) {
static $included = array();
static $ignore_deprecated = array('simplepie');
if (!isset($included[$file])) {
// Disable deprecated warning for libraries known for throwing them
if (in_array($library, $ignore_deprecated)) {
$level = error_reporting();
// We can safely use E_DEPRECATED since Drupal 7 requires PHP 5.3+
error_reporting($level ^ E_DEPRECATED ^ E_STRICT);
}
$included[$file] = FALSE;
$library_dir = variable_get('feeds_library_dir', FALSE);
$feeds_library_path = DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/$file";
......@@ -995,15 +989,9 @@ function feeds_include_library($file, $library) {
require $feeds_library_path;
$included[$file] = TRUE;
}
// Restore error reporting level
if (isset($level)) {
error_reporting($level);
}
}
if (isset($included[$file])) {
return TRUE;
}
return FALSE;
return $included[$file];
}
/**
......
......@@ -67,10 +67,6 @@ class FeedsSimplePieParser extends FeedsParser {
public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result) {
feeds_include_simplepie();
// Please be quiet SimplePie.
$level = error_reporting();
error_reporting($level ^ E_DEPRECATED ^ E_STRICT);
// Initialize SimplePie.
$parser = new SimplePie();
$parser->set_raw_data($fetcher_result->getRaw());
......@@ -149,8 +145,7 @@ class FeedsSimplePieParser extends FeedsParser {
}
// Release parser.
unset($parser);
// Set error reporting back to its previous value.
error_reporting($level);
return $result;
}
......
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