Skip to content
Snippets Groups Projects
Commit fab2a018 authored by mongolito404's avatar mongolito404 Committed by Frank Febbraro
Browse files

Issue #1128418 by mongolito404, Niklas Fiekas, jief: Fixed Deprecated:...

Issue #1128418 by mongolito404, Niklas Fiekas, jief: Fixed Deprecated: Assigning the return value of new by reference is deprecated in feeds_include_library().
parent a960a7f5
No related branches found
No related tags found
No related merge requests found
...@@ -902,7 +902,14 @@ function feeds_plugin($plugin, $id) { ...@@ -902,7 +902,14 @@ function feeds_plugin($plugin, $id) {
*/ */
function feeds_include_library($file, $library) { function feeds_include_library($file, $library) {
static $included = array(); static $included = array();
static $ignore_deprecated = array('simplepie');
if (!isset($included[$file])) { 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);
}
// Try first whether libraries module is present and load the file from // Try first whether libraries module is present and load the file from
// there. If this fails, require the library from the local path. // there. If this fails, require the library from the local path.
if (module_exists('libraries') && file_exists(libraries_get_path($library) . "/$file")) { if (module_exists('libraries') && file_exists(libraries_get_path($library) . "/$file")) {
...@@ -913,6 +920,10 @@ function feeds_include_library($file, $library) { ...@@ -913,6 +920,10 @@ function feeds_include_library($file, $library) {
// by reference is deprecated." // by reference is deprecated."
require DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/$file"; require DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/$file";
} }
// Restore error reporting level
if (isset($level)) {
error_reporting($level);
}
} }
$included[$file] = TRUE; $included[$file] = TRUE;
} }
......
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