diff options
author | filip <filip.komar@gmail.com> | 2021-04-13 12:41:24 +0200 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2021-04-13 12:41:24 +0200 |
commit | e065d637d9aff8e59e44d5c0553fd4c50509951c (patch) | |
tree | 17f131cbb670bae8767efc75e1c7e4c11d5be287 /lib/simplepie/library/SimplePie/Item.php | |
parent | 63276079bbaa3c53e1fdfe3ab44e97a16c1741f9 (diff) | |
download | www-e065d637d9aff8e59e44d5c0553fd4c50509951c.tar www-e065d637d9aff8e59e44d5c0553fd4c50509951c.tar.gz www-e065d637d9aff8e59e44d5c0553fd4c50509951c.tar.bz2 www-e065d637d9aff8e59e44d5c0553fd4c50509951c.tar.xz www-e065d637d9aff8e59e44d5c0553fd4c50509951c.zip |
update SimplePie for compatibility php 7.4 and 8
Diffstat (limited to 'lib/simplepie/library/SimplePie/Item.php')
-rw-r--r-- | lib/simplepie/library/SimplePie/Item.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/simplepie/library/SimplePie/Item.php b/lib/simplepie/library/SimplePie/Item.php index 9b9c1f5db..3ac4fa882 100644 --- a/lib/simplepie/library/SimplePie/Item.php +++ b/lib/simplepie/library/SimplePie/Item.php @@ -5,7 +5,7 @@ * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * - * Copyright (c) 2004-2016, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors + * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -33,9 +33,9 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @copyright 2004-2016 Ryan Parman, Geoffrey Sneddon, Ryan McCue + * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue * @author Ryan Parman - * @author Geoffrey Sneddon + * @author Sam Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License @@ -121,7 +121,7 @@ class SimplePie_Item */ public function __destruct() { - if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) + if (!gc_enabled()) { unset($this->feed); } @@ -958,7 +958,7 @@ class SimplePie_Item public function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); - if ($links[$key] !== null) + if ($links && $links[$key] !== null) { return $links[$key]; } @@ -1803,7 +1803,7 @@ class SimplePie_Item } if (isset($content['attribs']['']['fileSize'])) { - $length = ceil($content['attribs']['']['fileSize']); + $length = intval($content['attribs']['']['fileSize']); } if (isset($content['attribs']['']['medium'])) { @@ -2425,7 +2425,7 @@ class SimplePie_Item } if (isset($content['attribs']['']['fileSize'])) { - $length = ceil($content['attribs']['']['fileSize']); + $length = intval($content['attribs']['']['fileSize']); } if (isset($content['attribs']['']['medium'])) { @@ -2790,7 +2790,7 @@ class SimplePie_Item } if (isset($link['attribs']['']['length'])) { - $length = ceil($link['attribs']['']['length']); + $length = intval($link['attribs']['']['length']); } if (isset($link['attribs']['']['title'])) { @@ -2833,7 +2833,7 @@ class SimplePie_Item } if (isset($link['attribs']['']['length'])) { - $length = ceil($link['attribs']['']['length']); + $length = intval($link['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor @@ -2862,13 +2862,14 @@ class SimplePie_Item $width = null; $url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0])); + $url = $this->feed->sanitize->https_url($url); if (isset($enclosure[0]['attribs']['']['type'])) { $type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($enclosure[0]['attribs']['']['length'])) { - $length = ceil($enclosure[0]['attribs']['']['length']); + $length = intval($enclosure[0]['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor |