Bladeren bron

Correction of the feed mechanism (Simplepie)

Cebabonet 6 jaren geleden
bovenliggende
commit
7d9d1e8960
1 gewijzigde bestanden met toevoegingen van 50 en 50 verwijderingen
  1. 50 50
      classes/simplepie.class.php

+ 50 - 50
classes/simplepie.class.php Bestand weergeven

@@ -90,7 +90,7 @@ class SimplePie
90 90
 
91 91
     public function feed_url($url)
92 92
     {
93
-        $this->rss_url = SimplePie_Misc::fix_protocol($url, 1);
93
+        $this->rss_url = (new SimplePie_Misc)->fix_protocol($url, 1);
94 94
     }
95 95
 
96 96
     public function set_file(&$file)
@@ -147,7 +147,7 @@ class SimplePie
147 147
 
148 148
     public function set_cache_class($class = 'SimplePie_Cache')
149 149
     {
150
-        if (SimplePie_Misc::is_a_class($class, 'SimplePie_Cache')) {
150
+        if ((new SimplePie_Misc)->is_a_class($class, 'SimplePie_Cache')) {
151 151
             $this->cache_class = $class;
152 152
             return true;
153 153
         }
@@ -156,7 +156,7 @@ class SimplePie
156 156
 
157 157
     public function set_locator_class($class = 'SimplePie_Locator')
158 158
     {
159
-        if (SimplePie_Misc::is_a_class($class, 'SimplePie_Locator')) {
159
+        if ((new SimplePie_Misc)->is_a_class($class, 'SimplePie_Locator')) {
160 160
             $this->locator_class = $class;
161 161
             return true;
162 162
         }
@@ -165,7 +165,7 @@ class SimplePie
165 165
 
166 166
     public function set_parser_class($class = 'SimplePie_Parser')
167 167
     {
168
-        if (SimplePie_Misc::is_a_class($class, 'SimplePie_Parser')) {
168
+        if ((new SimplePie_Misc)->is_a_class($class, 'SimplePie_Parser')) {
169 169
             $this->parser_class = $class;
170 170
             return true;
171 171
         }
@@ -174,7 +174,7 @@ class SimplePie
174 174
 
175 175
     public function set_file_class($class = 'SimplePie_File')
176 176
     {
177
-        if (SimplePie_Misc::is_a_class($class, 'SimplePie_File')) {
177
+        if ((new SimplePie_Misc)->is_a_class($class, 'SimplePie_File')) {
178 178
             $this->file_class = $class;
179 179
             return true;
180 180
         }
@@ -298,7 +298,7 @@ class SimplePie
298 298
             if (get_magic_quotes_gpc()) {
299 299
                 $_GET[$this->sanitize->bypass_image_hotlink] = stripslashes($_GET[$this->sanitize->bypass_image_hotlink]);
300 300
             }
301
-            SimplePie_Misc::display_file($_GET[$this->sanitize->bypass_image_hotlink], 10, $this->useragent);
301
+            (new SimplePie_Misc)->display_file($_GET[$this->sanitize->bypass_image_hotlink], 10, $this->useragent);
302 302
         }
303 303
 
304 304
         if (isset($_GET['js'])) {
@@ -421,13 +421,13 @@ EOT;
421 421
                     if ($feed) {
422 422
                         if ($cache && !$cache->save(array('url' => $this->rss_url, 'feed_url' => $feed))) {
423 423
                             $this->error = "$cache->name is not writeable";
424
-                            SimplePie_Misc::error($this->error, E_USER_WARNING, __FILE__, __LINE__);
424
+                            (new SimplePie_Misc)->error($this->error, E_USER_WARNING, __FILE__, __LINE__);
425 425
                         }
426 426
                         $this->rss_url = $feed;
427 427
                         return $this->init();
428 428
                     } else {
429 429
                         $this->error = "A feed could not be found at $this->rss_url";
430
-                        SimplePie_Misc::error($this->error, E_USER_WARNING, __FILE__, __LINE__);
430
+                        (new SimplePie_Misc)->error($this->error, E_USER_WARNING, __FILE__, __LINE__);
431 431
                         return false;
432 432
                     }
433 433
                 }
@@ -478,7 +478,7 @@ EOT;
478 478
             }
479 479
 
480 480
             // Change the encoding to UTF-8 (as we always use UTF-8 internally)
481
-            $data = SimplePie_Misc::change_encoding($data, $encoding, 'UTF-8');
481
+            $data = (new SimplePie_Misc)->change_encoding($data, $encoding, 'UTF-8');
482 482
 
483 483
             // Strip illegal characters (if on less  than PHP5, as on PHP5 expat can manage fine)
484 484
             if (version_compare(phpversion(), '5', '<')) {
@@ -487,7 +487,7 @@ EOT;
487 487
                 } elseif (function_exists('mb_convert_encoding')) {
488 488
                     $data = mb_convert_encoding($data, 'UTF-8', 'UTF-8');
489 489
                 } else {
490
-                    $data = SimplePie_Misc::utf8_bad_replace($data);
490
+                    $data = (new SimplePie_Misc)->utf8_bad_replace($data);
491 491
                 }
492 492
             }
493 493
 
@@ -539,14 +539,14 @@ EOT;
539 539
                 // Cache the file if caching is enabled
540 540
                 if ($cache && !$cache->save($this->data)) {
541 541
                     $this->error = "$cache->name is not writeable";
542
-                    SimplePie_Misc::error($this->error, E_USER_WARNING, __FILE__, __LINE__);
542
+                    (new SimplePie_Misc)->error($this->error, E_USER_WARNING, __FILE__, __LINE__);
543 543
                 }
544 544
                 return true;
545 545
             }
546 546
             // If we have an error, just set SimplePie::error to it and quit
547 547
             else {
548 548
                 $this->error = "XML error: $data->error_string at line $data->current_line, column $data->current_column";
549
-                SimplePie_Misc::error($this->error, E_USER_WARNING, __FILE__, __LINE__);
549
+                (new SimplePie_Misc)->error($this->error, E_USER_WARNING, __FILE__, __LINE__);
550 550
                 return false;
551 551
             }
552 552
         }
@@ -595,7 +595,7 @@ EOT;
595 595
     public function get_favicon($check = false, $alternate = null)
596 596
     {
597 597
         if (!empty($this->data['info']['link']['alternate'][0])) {
598
-            $favicon = SimplePie_Misc::absolutize_url('/favicon.ico', $this->get_feed_link());
598
+            $favicon = (new SimplePie_Misc)->absolutize_url('/favicon.ico', $this->get_feed_link());
599 599
 
600 600
             if ($check) {
601 601
                 $file = new $this->file_class($favicon, $this->timeout/10, 5, null, $this->useragent, $this->force_fsockopen);
@@ -628,7 +628,7 @@ EOT;
628 628
     public function subscribe_feed()
629 629
     {
630 630
         if (!empty($this->rss_url)) {
631
-            return SimplePie_Misc::fix_protocol($this->rss_url, 2);
631
+            return (new SimplePie_Misc)->fix_protocol($this->rss_url, 2);
632 632
         } else {
633 633
             return false;
634 634
         }
@@ -637,7 +637,7 @@ EOT;
637 637
     public function subscribe_outlook()
638 638
     {
639 639
         if (!empty($this->rss_url)) {
640
-            return 'outlook' . SimplePie_Misc::fix_protocol($this->rss_url, 2);
640
+            return 'outlook' . (new SimplePie_Misc)->fix_protocol($this->rss_url, 2);
641 641
         } else {
642 642
             return false;
643 643
         }
@@ -646,7 +646,7 @@ EOT;
646 646
     public function subscribe_podcast()
647 647
     {
648 648
         if (!empty($this->rss_url)) {
649
-            return SimplePie_Misc::fix_protocol($this->rss_url, 3);
649
+            return (new SimplePie_Misc)->fix_protocol($this->rss_url, 3);
650 650
         } else {
651 651
             return false;
652 652
         }
@@ -1745,7 +1745,7 @@ class SimplePie_File
1745 1745
             if (!is_array($headers)) {
1746 1746
                 $headers = array();
1747 1747
             }
1748
-            if (extension_loaded('curl') && version_compare(SimplePie_Misc::get_curl_version(), '7.10.5', '>=') && !$force_fsockopen) {
1748
+            if (extension_loaded('curl') && version_compare((new SimplePie_Misc)->get_curl_version(), '7.10.5', '>=') && !$force_fsockopen) {
1749 1749
                 $this->method = 'curl';
1750 1750
                 $fp = curl_init();
1751 1751
                 $headers2 = array();
@@ -1991,12 +1991,12 @@ class SimplePie_Misc
1991 1991
         $relative = trim($relative);
1992 1992
         $base = trim($base);
1993 1993
         if (!empty($relative)) {
1994
-            $relative = SimplePie_Misc::parse_url($relative, false);
1994
+            $relative = (new SimplePie_Misc)->parse_url($relative, false);
1995 1995
             $relative = array('scheme' => $relative[2], 'authority' => $relative[3], 'path' => $relative[5], 'query' => $relative[7], 'fragment' => $relative[9]);
1996 1996
             if (!empty($relative['scheme'])) {
1997 1997
                 $target = $relative;
1998 1998
             } elseif (!empty($base)) {
1999
-                $base = SimplePie_Misc::parse_url($base, false);
1999
+                $base = (new SimplePie_Misc)->parse_url($base, false);
2000 2000
                 $base = array('scheme' => $base[2], 'authority' => $base[3], 'path' => $base[5], 'query' => $base[7], 'fragment' => $base[9]);
2001 2001
                 $target['scheme'] = $base['scheme'];
2002 2002
                 if (!empty($relative['authority'])) {
@@ -2025,12 +2025,12 @@ class SimplePie_Misc
2025 2025
                                 $input = substr($input, 2);
2026 2026
                             } elseif (strpos($input, '/./') === 0) {
2027 2027
                                 $input = substr_replace($input, '/', 0, 3);
2028
-                            } elseif (strpos($input, '/.') === 0 && SimplePie_Misc::strendpos($input, '/.') === 0) {
2028
+                            } elseif (strpos($input, '/.') === 0 && (new SimplePie_Misc)->strendpos($input, '/.') === 0) {
2029 2029
                                 $input = substr_replace($input, '/', -2);
2030 2030
                             } elseif (strpos($input, '/../') === 0) {
2031 2031
                                 $input = substr_replace($input, '/', 0, 4);
2032 2032
                                 $target['path'] = preg_replace('/(\/)?([^\/]+)$/msiU', '', $target['path']);
2033
-                            } elseif (strpos($input, '/..') === 0 && SimplePie_Misc::strendpos($input, '/..') === 0) {
2033
+                            } elseif (strpos($input, '/..') === 0 && (new SimplePie_Misc)->strendpos($input, '/..') === 0) {
2034 2034
                                 $input = substr_replace($input, '/', 0, 3);
2035 2035
                                 $target['path'] = preg_replace('/(\/)?([^\/]+)$/msiU', '', $target['path']);
2036 2036
                             } elseif ($input == '.' || $input == '..') {
@@ -2163,12 +2163,12 @@ class SimplePie_Misc
2163 2163
 
2164 2164
     public function fix_protocol($url, $http = 1)
2165 2165
     {
2166
-        $parsed = SimplePie_Misc::parse_url($url);
2166
+        $parsed = (new SimplePie_Misc)->parse_url($url);
2167 2167
         if (!empty($parsed['scheme']) && strtolower($parsed['scheme']) != 'http' && strtolower($parsed['scheme']) != 'https') {
2168
-            return SimplePie_Misc::fix_protocol("$parsed[authority]$parsed[path]$parsed[query]$parsed[fragment]", $http);
2168
+            return (new SimplePie_Misc)->fix_protocol("$parsed[authority]$parsed[path]$parsed[query]$parsed[fragment]", $http);
2169 2169
         }
2170 2170
         if (!file_exists($url) && empty($parsed['scheme'])) {
2171
-            return SimplePie_Misc::fix_protocol("http://$url", $http);
2171
+            return (new SimplePie_Misc)->fix_protocol("http://$url", $http);
2172 2172
         }
2173 2173
 
2174 2174
         if ($http == 2 && !empty($parsed['scheme'])) {
@@ -2233,8 +2233,8 @@ class SimplePie_Misc
2233 2233
 
2234 2234
     public function change_encoding($data, $input, $output)
2235 2235
     {
2236
-        $input = SimplePie_Misc::encoding($input);
2237
-        $output = SimplePie_Misc::encoding($output);
2236
+        $input = (new SimplePie_Misc)->encoding($input);
2237
+        $output = (new SimplePie_Misc)->encoding($output);
2238 2238
 
2239 2239
         if ($input != $output) {
2240 2240
             if (function_exists('iconv') && $input['use_iconv'] && $output['use_iconv'] && iconv($input['encoding'], "$output[encoding]//TRANSLIT", $data)) {
@@ -3117,13 +3117,13 @@ class SimplePie_Locator
3117 3117
 
3118 3118
     public function autodiscovery(&$file)
3119 3119
     {
3120
-        $links = SimplePie_Misc::get_element('link', $file->body());
3120
+        $links = (new SimplePie_Misc)->get_element('link', $file->body());
3121 3121
         $done = array();
3122 3122
         foreach ($links as $link) {
3123 3123
             if (!empty($link['attribs']['TYPE']['data']) && !empty($link['attribs']['HREF']['data']) && !empty($link['attribs']['REL']['data'])) {
3124 3124
                 $rel = preg_split('/\s+/', strtolower(trim($link['attribs']['REL']['data'])));
3125 3125
                 $type = preg_match('/^(application\/rss\+xml|application\/atom\+xml|application\/rdf\+xml|application\/xml\+rss|application\/xml\+atom|application\/xml\+rdf|application\/xml|application\/x\.atom\+xml|text\/xml)(;|$)/msiU', trim($link['attribs']['TYPE']['data']));
3126
-                $href = SimplePie_Misc::absolutize_url(trim($link['attribs']['HREF']['data']), $this->file->url);
3126
+                $href = (new SimplePie_Misc)->absolutize_url(trim($link['attribs']['HREF']['data']), $this->file->url);
3127 3127
                 if (!in_array($href, $done) && in_array('alternate', $rel) && $type) {
3128 3128
                     $feed = $this->is_feed($href);
3129 3129
                     if ($feed) {
@@ -3138,17 +3138,17 @@ class SimplePie_Locator
3138 3138
 
3139 3139
     public function get_links(&$file)
3140 3140
     {
3141
-        $links = SimplePie_Misc::get_element('a', $file->body());
3141
+        $links = (new SimplePie_Misc)->get_element('a', $file->body());
3142 3142
         foreach ($links as $link) {
3143 3143
             if (!empty($link['attribs']['HREF']['data'])) {
3144 3144
                 $href = trim($link['attribs']['HREF']['data']);
3145
-                $parsed = SimplePie_Misc::parse_url($href);
3145
+                $parsed = (new SimplePie_Misc)->parse_url($href);
3146 3146
                 if (empty($parsed['scheme']) || $parsed['scheme'] != 'javascript') {
3147
-                    $current = SimplePie_Misc::parse_url($this->file->url);
3147
+                    $current = (new SimplePie_Misc)->parse_url($this->file->url);
3148 3148
                     if (empty($parsed['authority']) || $parsed['authority'] == $current['authority']) {
3149
-                        $this->local[] = SimplePie_Misc::absolutize_url($href, $this->file->url);
3149
+                        $this->local[] = (new SimplePie_Misc)->absolutize_url($href, $this->file->url);
3150 3150
                     } else {
3151
-                        $this->elsewhere[] = SimplePie_Misc::absolutize_url($href, $this->file->url);
3151
+                        $this->elsewhere[] = (new SimplePie_Misc)->absolutize_url($href, $this->file->url);
3152 3152
                     }
3153 3153
                 }
3154 3154
             }
@@ -3168,7 +3168,7 @@ class SimplePie_Locator
3168 3168
     public function extension(&$array)
3169 3169
     {
3170 3170
         foreach ($array as $key => $value) {
3171
-            $value = SimplePie_Misc::absolutize_url($value, $this->file->url);
3171
+            $value = (new SimplePie_Misc)->absolutize_url($value, $this->file->url);
3172 3172
             if (in_array(strrchr($value, '.'), array('.rss', '.rdf', '.atom', '.xml'))) {
3173 3173
                 if ($this->is_feed($value)) {
3174 3174
                     return $value;
@@ -3183,7 +3183,7 @@ class SimplePie_Locator
3183 3183
     public function body(&$array)
3184 3184
     {
3185 3185
         foreach ($array as $key => $value) {
3186
-            $value = SimplePie_Misc::absolutize_url($value, $this->file->url);
3186
+            $value = (new SimplePie_Misc)->absolutize_url($value, $this->file->url);
3187 3187
             if (preg_match('/(rss|rdf|atom|xml)/i', $value)) {
3188 3188
                 if ($this->is_feed($value)) {
3189 3189
                     return $value;
@@ -3874,7 +3874,7 @@ class SimplePie_Sanitize
3874 3874
 
3875 3875
     public function set_item_class($class = 'SimplePie_Item')
3876 3876
     {
3877
-        if (SimplePie_Misc::is_a_class($class, 'SimplePie_Item')) {
3877
+        if ((new SimplePie_Misc)->is_a_class($class, 'SimplePie_Item')) {
3878 3878
             $this->item_class = $class;
3879 3879
             return true;
3880 3880
         }
@@ -3883,7 +3883,7 @@ class SimplePie_Sanitize
3883 3883
 
3884 3884
     public function set_author_class($class = 'SimplePie_Author')
3885 3885
     {
3886
-        if (SimplePie_Misc::is_a_class($class, 'SimplePie_Author')) {
3886
+        if ((new SimplePie_Misc)->is_a_class($class, 'SimplePie_Author')) {
3887 3887
             $this->author_class = $class;
3888 3888
             return true;
3889 3889
         }
@@ -3892,7 +3892,7 @@ class SimplePie_Sanitize
3892 3892
 
3893 3893
     public function set_enclosure_class($class = 'SimplePie_Enclosure')
3894 3894
     {
3895
-        if (SimplePie_Misc::is_a_class($class, 'SimplePie_Enclosure')) {
3895
+        if ((new SimplePie_Misc)->is_a_class($class, 'SimplePie_Enclosure')) {
3896 3896
             $this->enclosure_class = $class;
3897 3897
             return true;
3898 3898
         }
@@ -3914,7 +3914,7 @@ class SimplePie_Sanitize
3914 3914
         }
3915 3915
         // FeedBurner feeds use alternate link
3916 3916
         elseif (strpos($url, 'http://feeds.feedburner.com/') !== 0) {
3917
-            $this->feed_xmlbase = SimplePie_Misc::parse_url($url);
3917
+            $this->feed_xmlbase = (new SimplePie_Misc)->parse_url($url);
3918 3918
             if (empty($this->feed_xmlbase['authority'])) {
3919 3919
                 $this->feed_xmlbase = preg_replace('/^' . preg_quote(realpath($_SERVER['DOCUMENT_ROOT']), '/') . '/', '', realpath($url));
3920 3920
             } else {
@@ -4023,9 +4023,9 @@ class SimplePie_Sanitize
4023 4023
 
4024 4024
                 // Item level xml:base
4025 4025
                 if (!empty($item['attribs']['XML:BASE'])) {
4026
-                    $this->item_xmlbase = SimplePie_Misc::absolutize_url($item['attribs']['XML:BASE'], $this->feed_xmlbase);
4026
+                    $this->item_xmlbase = (new SimplePie_Misc)->absolutize_url($item['attribs']['XML:BASE'], $this->feed_xmlbase);
4027 4027
                 } elseif (!empty($item['attribs']['HTTP://WWW.W3.ORG/XML/1998/NAMESPACE:BASE'])) {
4028
-                    $this->item_xmlbase = SimplePie_Misc::absolutize_url($item['attribs']['HTTP://WWW.W3.ORG/XML/1998/NAMESPACE:BASE'], $this->feed_xmlbase);
4028
+                    $this->item_xmlbase = (new SimplePie_Misc)->absolutize_url($item['attribs']['HTTP://WWW.W3.ORG/XML/1998/NAMESPACE:BASE'], $this->feed_xmlbase);
4029 4029
                 } else {
4030 4030
                     $this->item_xmlbase = null;
4031 4031
                 }
@@ -4259,7 +4259,7 @@ class SimplePie_Sanitize
4259 4259
 
4260 4260
         // If Bypass Image Hotlink is enabled, rewrite all the image tags.
4261 4261
         if ($this->bypass_image_hotlink) {
4262
-            $images = SimplePie_Misc::get_element('img', $data);
4262
+            $images = (new SimplePie_Misc)->get_element('img', $data);
4263 4263
             foreach ($images as $img) {
4264 4264
                 if (!empty($img['attribs']['SRC']['data'])) {
4265 4265
                     $pre = '';
@@ -4268,7 +4268,7 @@ class SimplePie_Sanitize
4268 4268
                     }
4269 4269
                     $pre .= "?$this->bypass_image_hotlink=";
4270 4270
                     $img['attribs']['SRC']['data'] = $pre . rawurlencode(strtr($img['attribs']['SRC']['data'], array_flip(get_html_translation_table(HTML_SPECIALCHARS, ENT_QUOTES))));
4271
-                    $data = str_replace($img['full'], SimplePie_Misc::element_implode($img), $data);
4271
+                    $data = str_replace($img['full'], (new SimplePie_Misc)->element_implode($img), $data);
4272 4272
                 }
4273 4273
             }
4274 4274
         }
@@ -4291,7 +4291,7 @@ class SimplePie_Sanitize
4291 4291
         }
4292 4292
 
4293 4293
         // Convert encoding
4294
-        $data = SimplePie_Misc::change_encoding($data, $this->input_encoding, $this->output_encoding);
4294
+        $data = (new SimplePie_Misc)->change_encoding($data, $this->input_encoding, $this->output_encoding);
4295 4295
 
4296 4296
         return $data;
4297 4297
     }
@@ -4324,9 +4324,9 @@ class SimplePie_Sanitize
4324 4324
         }
4325 4325
         if (!empty($xmlbase)) {
4326 4326
             if (!empty($this->item_xmlbase)) {
4327
-                $xmlbase = SimplePie_Misc::absolutize_url($xmlbase, $this->item_xmlbase);
4327
+                $xmlbase = (new SimplePie_Misc)->absolutize_url($xmlbase, $this->item_xmlbase);
4328 4328
             } else {
4329
-                $xmlbase = SimplePie_Misc::absolutize_url($xmlbase, $this->feed_xmlbase);
4329
+                $xmlbase = (new SimplePie_Misc)->absolutize_url($xmlbase, $this->feed_xmlbase);
4330 4330
             }
4331 4331
         } elseif (!empty($this->item_xmlbase)) {
4332 4332
             $xmlbase = $this->item_xmlbase;
@@ -4335,7 +4335,7 @@ class SimplePie_Sanitize
4335 4335
         }
4336 4336
 
4337 4337
         if ($raw_url) {
4338
-            return SimplePie_Misc::absolutize_url($data, $xmlbase);
4338
+            return (new SimplePie_Misc)->absolutize_url($data, $xmlbase);
4339 4339
         } else {
4340 4340
             $attributes = array(
4341 4341
                 'background',
@@ -4353,7 +4353,7 @@ class SimplePie_Sanitize
4353 4353
             );
4354 4354
             foreach ($attributes as $attribute) {
4355 4355
                 if (preg_match("/$attribute='(.*)'/siU", $data[0], $attrib) || preg_match("/$attribute=\"(.*)\"/siU", $data[0], $attrib) || preg_match("/$attribute=(.*)[ |\/|>]/siU", $data[0], $attrib)) {
4356
-                    $new_tag = str_replace($attrib[1], SimplePie_Misc::absolutize_url($attrib[1], $xmlbase), $attrib[0]);
4356
+                    $new_tag = str_replace($attrib[1], (new SimplePie_Misc)->absolutize_url($attrib[1], $xmlbase), $attrib[0]);
4357 4357
                     $data[0] = str_replace($attrib[0], $new_tag, $data[0]);
4358 4358
                 }
4359 4359
             }
@@ -4371,9 +4371,9 @@ class SimplePie_Sanitize
4371 4371
         if (isset($this->cached_entities[$data[0]])) {
4372 4372
             return $this->cached_entities[$data[0]];
4373 4373
         } else {
4374
-            $return = SimplePie_Misc::change_encoding(html_entity_decode($data[0], ENT_QUOTES), 'ISO-8859-1', $this->input_encoding);
4374
+            $return = (new SimplePie_Misc)->change_encoding(html_entity_decode($data[0], ENT_QUOTES), 'ISO-8859-1', $this->input_encoding);
4375 4375
             if ($return == $data[0]) {
4376
-                $return = SimplePie_Misc::change_encoding(preg_replace_callback('/&#([x]?[0-9a-f]+);/mi', array(&$this, 'replace_num_entity'), $data[0]), 'UTF-8', $this->input_encoding);
4376
+                $return = (new SimplePie_Misc)->change_encoding(preg_replace_callback('/&#([x]?[0-9a-f]+);/mi', array(&$this, 'replace_num_entity'), $data[0]), 'UTF-8', $this->input_encoding);
4377 4377
             }
4378 4378
             $this->cached_entities[$data[0]] = $return;
4379 4379
             return $return;