From fab2a0185ee373265472a80da322a233b4299135 Mon Sep 17 00:00:00 2001
From: mongolito404 <mongolito404@215342.no-reply.drupal.org>
Date: Thu, 8 Dec 2011 12:03:43 -0500
Subject: [PATCH] Issue #1128418 by mongolito404, Niklas Fiekas, jief: Fixed
 Deprecated: Assigning the return value of new by reference is deprecated in
 feeds_include_library().

---
 feeds.module | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/feeds.module b/feeds.module
index 543b24a0..802bf2cf 100644
--- a/feeds.module
+++ b/feeds.module
@@ -902,7 +902,14 @@ 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);
+    }
     // Try first whether libraries module is present and load the file from
     // there. If this fails, require the library from the local path.
     if (module_exists('libraries') && file_exists(libraries_get_path($library) . "/$file")) {
@@ -913,6 +920,10 @@ function feeds_include_library($file, $library) {
       // by reference is deprecated."
       require DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/$file";
     }
+    // Restore error reporting level
+    if (isset($level)) {
+      error_reporting($level);
+    }
   }
   $included[$file] = TRUE;
 }
-- 
GitLab