diff options
Diffstat (limited to 'lib/simplepie/library/SimplePie')
33 files changed, 280 insertions, 140 deletions
diff --git a/lib/simplepie/library/SimplePie/Author.php b/lib/simplepie/library/SimplePie/Author.php index 14794cf27..563932f4c 100644 --- a/lib/simplepie/library/SimplePie/Author.php +++ b/lib/simplepie/library/SimplePie/Author.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 diff --git a/lib/simplepie/library/SimplePie/Cache.php b/lib/simplepie/library/SimplePie/Cache.php index d98cc6511..9c5577d95 100644 --- a/lib/simplepie/library/SimplePie/Cache.php +++ b/lib/simplepie/library/SimplePie/Cache.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 diff --git a/lib/simplepie/library/SimplePie/Cache/Base.php b/lib/simplepie/library/SimplePie/Cache/Base.php index 333fb05cf..522ff7e10 100644 --- a/lib/simplepie/library/SimplePie/Cache/Base.php +++ b/lib/simplepie/library/SimplePie/Cache/Base.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 diff --git a/lib/simplepie/library/SimplePie/Cache/DB.php b/lib/simplepie/library/SimplePie/Cache/DB.php index 7e8f77532..74d57b8da 100644 --- a/lib/simplepie/library/SimplePie/Cache/DB.php +++ b/lib/simplepie/library/SimplePie/Cache/DB.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 diff --git a/lib/simplepie/library/SimplePie/Cache/File.php b/lib/simplepie/library/SimplePie/Cache/File.php index 6ba6c5f6e..03758e923 100644 --- a/lib/simplepie/library/SimplePie/Cache/File.php +++ b/lib/simplepie/library/SimplePie/Cache/File.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 @@ -101,7 +101,7 @@ class SimplePie_Cache_File implements SimplePie_Cache_Base */ public function save($data) { - if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location)) + if (file_exists($this->name) && is_writable($this->name) || file_exists($this->location) && is_writable($this->location)) { if ($data instanceof SimplePie) { diff --git a/lib/simplepie/library/SimplePie/Cache/Memcache.php b/lib/simplepie/library/SimplePie/Cache/Memcache.php index 5190eef93..caf785275 100644 --- a/lib/simplepie/library/SimplePie/Cache/Memcache.php +++ b/lib/simplepie/library/SimplePie/Cache/Memcache.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 diff --git a/lib/simplepie/library/SimplePie/Cache/Memcached.php b/lib/simplepie/library/SimplePie/Cache/Memcached.php index 1f73b3890..0b40d87c8 100755 --- a/lib/simplepie/library/SimplePie/Cache/Memcached.php +++ b/lib/simplepie/library/SimplePie/Cache/Memcached.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 diff --git a/lib/simplepie/library/SimplePie/Cache/MySQL.php b/lib/simplepie/library/SimplePie/Cache/MySQL.php index 061ed043a..a684eb833 100644 --- a/lib/simplepie/library/SimplePie/Cache/MySQL.php +++ b/lib/simplepie/library/SimplePie/Cache/MySQL.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 diff --git a/lib/simplepie/library/SimplePie/Caption.php b/lib/simplepie/library/SimplePie/Caption.php index 854857603..3d7bfdd71 100644 --- a/lib/simplepie/library/SimplePie/Caption.php +++ b/lib/simplepie/library/SimplePie/Caption.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 diff --git a/lib/simplepie/library/SimplePie/Category.php b/lib/simplepie/library/SimplePie/Category.php index df0f13f9a..e4dabed8b 100644 --- a/lib/simplepie/library/SimplePie/Category.php +++ b/lib/simplepie/library/SimplePie/Category.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 diff --git a/lib/simplepie/library/SimplePie/Content/Type/Sniffer.php b/lib/simplepie/library/SimplePie/Content/Type/Sniffer.php index b86dfa33c..027e131ef 100644 --- a/lib/simplepie/library/SimplePie/Content/Type/Sniffer.php +++ b/lib/simplepie/library/SimplePie/Content/Type/Sniffer.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 @@ -150,7 +150,7 @@ class SimplePie_Content_Type_Sniffer } elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) { - return 'application/octect-stream'; + return 'application/octet-stream'; } return 'text/plain'; diff --git a/lib/simplepie/library/SimplePie/Copyright.php b/lib/simplepie/library/SimplePie/Copyright.php index a57f323e6..92f9b0947 100644 --- a/lib/simplepie/library/SimplePie/Copyright.php +++ b/lib/simplepie/library/SimplePie/Copyright.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 diff --git a/lib/simplepie/library/SimplePie/Core.php b/lib/simplepie/library/SimplePie/Core.php index c856ba361..ffcca46f5 100644 --- a/lib/simplepie/library/SimplePie/Core.php +++ b/lib/simplepie/library/SimplePie/Core.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 diff --git a/lib/simplepie/library/SimplePie/Credit.php b/lib/simplepie/library/SimplePie/Credit.php index 064a1b864..d6ff07eba 100644 --- a/lib/simplepie/library/SimplePie/Credit.php +++ b/lib/simplepie/library/SimplePie/Credit.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 diff --git a/lib/simplepie/library/SimplePie/Decode/HTML/Entities.php b/lib/simplepie/library/SimplePie/Decode/HTML/Entities.php index 773481a8c..a43c374b3 100644 --- a/lib/simplepie/library/SimplePie/Decode/HTML/Entities.php +++ b/lib/simplepie/library/SimplePie/Decode/HTML/Entities.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 diff --git a/lib/simplepie/library/SimplePie/Enclosure.php b/lib/simplepie/library/SimplePie/Enclosure.php index ddbbc3c92..32216d848 100644 --- a/lib/simplepie/library/SimplePie/Enclosure.php +++ b/lib/simplepie/library/SimplePie/Enclosure.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 diff --git a/lib/simplepie/library/SimplePie/Exception.php b/lib/simplepie/library/SimplePie/Exception.php index 53c015e77..7a04c560c 100644 --- a/lib/simplepie/library/SimplePie/Exception.php +++ b/lib/simplepie/library/SimplePie/Exception.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 diff --git a/lib/simplepie/library/SimplePie/File.php b/lib/simplepie/library/SimplePie/File.php index c73e0fbc9..c326ba26a 100644 --- a/lib/simplepie/library/SimplePie/File.php +++ b/lib/simplepie/library/SimplePie/File.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 @@ -109,11 +109,6 @@ class SimplePie_File curl_setopt($fp, CURLOPT_REFERER, $url); curl_setopt($fp, CURLOPT_USERAGENT, $useragent); curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); - if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>=')) - { - curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1); - curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects); - } foreach ($curl_options as $curl_param => $curl_value) { curl_setopt($fp, $curl_param, $curl_value); } @@ -124,6 +119,7 @@ class SimplePie_File curl_setopt($fp, CURLOPT_ENCODING, 'none'); $this->headers = curl_exec($fp); } + $this->status_code = curl_getinfo($fp, CURLINFO_HTTP_CODE); if (curl_errno($fp)) { $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); @@ -148,7 +144,7 @@ class SimplePie_File $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); $previousStatusCode = $this->status_code; - $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options); $this->permanent_url = ($previousStatusCode == 301) ? $location : $url; return; } @@ -233,7 +229,7 @@ class SimplePie_File $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); $previousStatusCode = $this->status_code; - $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options); $this->permanent_url = ($previousStatusCode == 301) ? $location : $url; return; } diff --git a/lib/simplepie/library/SimplePie/HTTP/Parser.php b/lib/simplepie/library/SimplePie/HTTP/Parser.php index 7d6188dd1..1dbe06c3e 100644 --- a/lib/simplepie/library/SimplePie/HTTP/Parser.php +++ b/lib/simplepie/library/SimplePie/HTTP/Parser.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 diff --git a/lib/simplepie/library/SimplePie/IRI.php b/lib/simplepie/library/SimplePie/IRI.php index ffba232b1..a02de682c 100644 --- a/lib/simplepie/library/SimplePie/IRI.php +++ b/lib/simplepie/library/SimplePie/IRI.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 @@ -46,10 +46,10 @@ * * @package SimplePie * @subpackage HTTP - * @author Geoffrey Sneddon + * @author Sam Sneddon * @author Steve Minutillo * @author Ryan McCue - * @copyright 2007-2012 Geoffrey Sneddon, Steve Minutillo, Ryan McCue + * @copyright 2007-2012 Sam Sneddon, Steve Minutillo, Ryan McCue * @license http://www.opensource.org/licenses/bsd-license.php */ class SimplePie_IRI 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 diff --git a/lib/simplepie/library/SimplePie/Locator.php b/lib/simplepie/library/SimplePie/Locator.php index 3876a2da6..ebc7ec9c1 100644 --- a/lib/simplepie/library/SimplePie/Locator.php +++ b/lib/simplepie/library/SimplePie/Locator.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 @@ -75,12 +75,19 @@ class SimplePie_Locator $this->force_fsockopen = $force_fsockopen; $this->curl_options = $curl_options; - if (class_exists('DOMDocument')) + if (class_exists('DOMDocument') && $this->file->body != '') { $this->dom = new DOMDocument(); set_error_handler(array('SimplePie_Misc', 'silence_errors')); - $this->dom->loadHTML($this->file->body); + try + { + $this->dom->loadHTML($this->file->body); + } + catch (Throwable $ex) + { + $this->dom = null; + } restore_error_handler(); } else @@ -94,7 +101,7 @@ class SimplePie_Locator $this->registry = $registry; } - public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working) + public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working = null) { if ($this->is_feed($this->file)) { @@ -402,7 +409,7 @@ class SimplePie_Locator { break; } - if (preg_match('/(rss|rdf|atom|xml)/i', $value)) + if (preg_match('/(feed|rss|rdf|atom|xml)/i', $value)) { $this->checked_feeds++; $headers = array( diff --git a/lib/simplepie/library/SimplePie/Misc.php b/lib/simplepie/library/SimplePie/Misc.php index 2a2ecc575..a52498ac7 100644 --- a/lib/simplepie/library/SimplePie/Misc.php +++ b/lib/simplepie/library/SimplePie/Misc.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 @@ -364,11 +364,12 @@ class SimplePie_Misc } // Check that the encoding is supported - if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80") + if (!in_array($input, mb_list_encodings())) { return false; } - if (!in_array($input, mb_list_encodings())) + + if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80") { return false; } diff --git a/lib/simplepie/library/SimplePie/Net/IPv6.php b/lib/simplepie/library/SimplePie/Net/IPv6.php index a054e8be5..25c992bd1 100644 --- a/lib/simplepie/library/SimplePie/Net/IPv6.php +++ b/lib/simplepie/library/SimplePie/Net/IPv6.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 @@ -53,7 +53,7 @@ * @author Alexander Merz <alexander.merz@web.de> * @author elfrink at introweb dot nl * @author Josh Peck <jmp at joshpeck dot org> - * @author Geoffrey Sneddon <geoffers@gmail.com> + * @author Sam Sneddon <geoffers@gmail.com> */ class SimplePie_Net_IPv6 { diff --git a/lib/simplepie/library/SimplePie/Parse/Date.php b/lib/simplepie/library/SimplePie/Parse/Date.php index b29274c64..cf57437d2 100644 --- a/lib/simplepie/library/SimplePie/Parse/Date.php +++ b/lib/simplepie/library/SimplePie/Parse/Date.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 @@ -98,12 +98,20 @@ class SimplePie_Parse_Date 'dimanche' => 7, // German 'montag' => 1, + 'mo' => 1, 'dienstag' => 2, + 'di' => 2, 'mittwoch' => 3, + 'mi' => 3, 'donnerstag' => 4, + 'do' => 4, 'freitag' => 5, + 'fr' => 5, 'samstag' => 6, + 'sa' => 6, 'sonnabend' => 6, + // AFAIK no short form for sonnabend + 'so' => 7, 'sonntag' => 7, // Italian 'lunedì' => 1, @@ -145,6 +153,14 @@ class SimplePie_Parse_Date 'Παρ' => 5, 'Σαβ' => 6, 'Κυρ' => 7, + // Russian + 'Пн.' => 1, + 'Вт.' => 2, + 'Ср.' => 3, + 'Чт.' => 4, + 'Пт.' => 5, + 'Сб.' => 6, + 'Вс.' => 7, ); /** @@ -207,17 +223,28 @@ class SimplePie_Parse_Date 'décembre' => 12, // German 'januar' => 1, + 'jan' => 1, 'februar' => 2, + 'feb' => 2, 'märz' => 3, + 'mär' => 3, 'april' => 4, - 'mai' => 5, + 'apr' => 4, + 'mai' => 5, // no short form for may 'juni' => 6, + 'jun' => 6, 'juli' => 7, + 'jul' => 7, 'august' => 8, + 'aug' => 8, 'september' => 9, + 'sep' => 9, 'oktober' => 10, + 'okt' => 10, 'november' => 11, + 'nov' => 11, 'dezember' => 12, + 'dez' => 12, // Italian 'gennaio' => 1, 'febbraio' => 2, @@ -289,7 +316,33 @@ class SimplePie_Parse_Date 'Σεπ' => 9, 'Οκτ' => 10, 'Νοέ' => 11, - 'Δεκ' => 12, + 'Δεκ' => 12, + // Russian + 'Янв' => 1, + 'января' => 1, + 'Фев' => 2, + 'февраля' => 2, + 'Мар' => 3, + 'марта' => 3, + 'Апр' => 4, + 'апреля' => 4, + 'Май' => 5, + 'мая' => 5, + 'Июн' => 6, + 'июня' => 6, + 'Июл' => 7, + 'июля' => 7, + 'Авг' => 8, + 'августа' => 8, + 'Сен' => 9, + 'сентября' => 9, + 'Окт' => 10, + 'октября' => 10, + 'Ноя' => 11, + 'ноября' => 11, + 'Дек' => 12, + 'декабря' => 12, + ); /** @@ -541,8 +594,8 @@ class SimplePie_Parse_Date */ public function __construct() { - $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')'; - $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')'; + $this->day_pcre = '(' . implode('|', array_keys($this->day)) . ')'; + $this->month_pcre = '(' . implode('|', array_keys($this->month)) . ')'; static $cache; if (!isset($cache[get_class($this)])) @@ -690,7 +743,7 @@ class SimplePie_Parse_Date } // Convert the number of seconds to an integer, taking decimals into account - $second = round((int)$match[6] + (int)$match[7] / pow(10, strlen($match[7]))); + $second = round((int)$match[6] + (int)$match[7] / (10 ** strlen($match[7]))); return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone; } diff --git a/lib/simplepie/library/SimplePie/Parser.php b/lib/simplepie/library/SimplePie/Parser.php index 3cef2287d..3813b74b2 100644 --- a/lib/simplepie/library/SimplePie/Parser.php +++ b/lib/simplepie/library/SimplePie/Parser.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 @@ -164,12 +164,30 @@ class SimplePie_Parser xml_set_element_handler($xml, 'tag_open', 'tag_close'); // Parse! - if (!xml_parse($xml, $data, true)) + $wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory'; + if (($stream = fopen($wrapper, 'r+')) && + fwrite($stream, $data) && + rewind($stream)) + { + //Parse by chunks not to use too much memory + do + { + $stream_data = fread($stream, 1048576); + if (!xml_parse($xml, $stream_data === false ? '' : $stream_data, feof($stream))) + { + $this->error_code = xml_get_error_code($xml); + $this->error_string = xml_error_string($this->error_code); + $return = false; + break; + } + } while (!feof($stream)); + fclose($stream); + } + else { - $this->error_code = xml_get_error_code($xml); - $this->error_string = xml_error_string($this->error_code); $return = false; } + $this->current_line = xml_get_current_line_number($xml); $this->current_column = xml_get_current_column_number($xml); $this->current_byte = xml_get_current_byte_index($xml); diff --git a/lib/simplepie/library/SimplePie/Rating.php b/lib/simplepie/library/SimplePie/Rating.php index 108dd22bf..599f75acb 100644 --- a/lib/simplepie/library/SimplePie/Rating.php +++ b/lib/simplepie/library/SimplePie/Rating.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 diff --git a/lib/simplepie/library/SimplePie/Registry.php b/lib/simplepie/library/SimplePie/Registry.php index e0909bb74..bf3baf179 100755 --- a/lib/simplepie/library/SimplePie/Registry.php +++ b/lib/simplepie/library/SimplePie/Registry.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 diff --git a/lib/simplepie/library/SimplePie/Restriction.php b/lib/simplepie/library/SimplePie/Restriction.php index 803d84fde..950017fae 100644 --- a/lib/simplepie/library/SimplePie/Restriction.php +++ b/lib/simplepie/library/SimplePie/Restriction.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 diff --git a/lib/simplepie/library/SimplePie/Sanitize.php b/lib/simplepie/library/SimplePie/Sanitize.php index 40b066266..84d35ad25 100644 --- a/lib/simplepie/library/SimplePie/Sanitize.php +++ b/lib/simplepie/library/SimplePie/Sanitize.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 @@ -72,6 +72,14 @@ class SimplePie_Sanitize var $force_fsockopen = false; var $replace_url_attributes = null; + /** + * List of domains for which to force HTTPS. + * @see SimplePie_Sanitize::set_https_domains() + * Array is a tree split at DNS levels. Example: + * array('biz' => true, 'com' => array('example' => true), 'net' => array('example') => array('www' => true)) + */ + var $https_domains = array(); + public function __construct() { // Set defaults @@ -241,6 +249,68 @@ class SimplePie_Sanitize $this->replace_url_attributes = (array) $element_attribute; } + /** + * Set the list of domains for which to force HTTPS. + * @see SimplePie_Misc::https_url() + * Example array('biz', 'example.com', 'example.org', 'www.example.net'); + */ + public function set_https_domains($domains) + { + $this->https_domains = array(); + foreach ($domains as $domain) + { + $domain = trim($domain, ". \t\n\r\0\x0B"); + $segments = array_reverse(explode('.', $domain)); + $node =& $this->https_domains; + foreach ($segments as $segment) + {//Build a tree + if ($node === true) + { + break; + } + if (!isset($node[$segment])) + { + $node[$segment] = array(); + } + $node =& $node[$segment]; + } + $node = true; + } + } + + /** + * Check if the domain is in the list of forced HTTPS. + */ + protected function is_https_domain($domain) + { + $domain = trim($domain, '. '); + $segments = array_reverse(explode('.', $domain)); + $node =& $this->https_domains; + foreach ($segments as $segment) + {//Explore the tree + if (isset($node[$segment])) + { + $node =& $node[$segment]; + } + else + { + break; + } + } + return $node === true; + } + + /** + * Force HTTPS for selected Web sites. + */ + public function https_url($url) + { + return (strtolower(substr($url, 0, 7)) === 'http://') && + $this->is_https_domain(parse_url($url, PHP_URL_HOST)) ? + substr_replace($url, 's', 4, 0) : //Add the 's' to HTTPS + $url; + } + public function sanitize($data, $type, $base = '') { $data = trim($data); @@ -365,14 +435,7 @@ class SimplePie_Sanitize // Get content node $div = $document->getElementsByTagName('body')->item(0)->firstChild; // Finally, convert to a HTML string - if (version_compare(PHP_VERSION, '5.3.6', '>=')) - { - $data = trim($document->saveHTML($div)); - } - else - { - $data = trim($document->saveXML($div)); - } + $data = trim($document->saveHTML($div)); if ($this->remove_div) { @@ -450,6 +513,7 @@ class SimplePie_Sanitize $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base)); if ($value !== false) { + $value = $this->https_url($value); $element->setAttribute($attribute, $value); } } diff --git a/lib/simplepie/library/SimplePie/Source.php b/lib/simplepie/library/SimplePie/Source.php index 8fac13ef7..f14e5b220 100644 --- a/lib/simplepie/library/SimplePie/Source.php +++ b/lib/simplepie/library/SimplePie/Source.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 diff --git a/lib/simplepie/library/SimplePie/XML/Declaration/Parser.php b/lib/simplepie/library/SimplePie/XML/Declaration/Parser.php index 18ca1b79b..0c857a586 100644 --- a/lib/simplepie/library/SimplePie/XML/Declaration/Parser.php +++ b/lib/simplepie/library/SimplePie/XML/Declaration/Parser.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 diff --git a/lib/simplepie/library/SimplePie/gzdecode.php b/lib/simplepie/library/SimplePie/gzdecode.php index f4aeafa28..9c54f8833 100644 --- a/lib/simplepie/library/SimplePie/gzdecode.php +++ b/lib/simplepie/library/SimplePie/gzdecode.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 |