From 00ba1348ff9f43a382a03891700db1e5d058f5c6 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Tue, 30 Oct 2012 15:16:22 -0400 Subject: [News] SimplePie library updated to 1.3.1 --- 3rdparty/SimplePie/autoloader.php | 2 +- 3rdparty/SimplePie/library/SimplePie.php | 97 ++++++++++++++++++++-- 3rdparty/SimplePie/library/SimplePie/Author.php | 3 +- 3rdparty/SimplePie/library/SimplePie/Cache.php | 15 +++- .../SimplePie/library/SimplePie/Cache/Base.php | 2 +- 3rdparty/SimplePie/library/SimplePie/Cache/DB.php | 2 +- .../SimplePie/library/SimplePie/Cache/File.php | 2 +- .../SimplePie/library/SimplePie/Cache/Memcache.php | 2 +- .../SimplePie/library/SimplePie/Cache/MySQL.php | 2 +- 3rdparty/SimplePie/library/SimplePie/Caption.php | 3 +- 3rdparty/SimplePie/library/SimplePie/Category.php | 3 +- .../library/SimplePie/Content/Type/Sniffer.php | 3 +- 3rdparty/SimplePie/library/SimplePie/Copyright.php | 3 +- 3rdparty/SimplePie/library/SimplePie/Core.php | 2 +- 3rdparty/SimplePie/library/SimplePie/Credit.php | 3 +- .../library/SimplePie/Decode/HTML/Entities.php | 3 +- 3rdparty/SimplePie/library/SimplePie/Enclosure.php | 3 +- 3rdparty/SimplePie/library/SimplePie/File.php | 2 +- .../SimplePie/library/SimplePie/HTTP/Parser.php | 2 +- 3rdparty/SimplePie/library/SimplePie/IRI.php | 10 ++- 3rdparty/SimplePie/library/SimplePie/Item.php | 3 +- 3rdparty/SimplePie/library/SimplePie/Locator.php | 47 +++++++++-- 3rdparty/SimplePie/library/SimplePie/Misc.php | 17 ++-- 3rdparty/SimplePie/library/SimplePie/Net/IPv6.php | 2 +- .../SimplePie/library/SimplePie/Parse/Date.php | 3 +- 3rdparty/SimplePie/library/SimplePie/Parser.php | 10 ++- 3rdparty/SimplePie/library/SimplePie/Rating.php | 2 +- 3rdparty/SimplePie/library/SimplePie/Registry.php | 18 +++- .../SimplePie/library/SimplePie/Restriction.php | 2 +- 3rdparty/SimplePie/library/SimplePie/Sanitize.php | 15 +++- 3rdparty/SimplePie/library/SimplePie/Source.php | 3 +- .../library/SimplePie/XML/Declaration/Parser.php | 2 +- 3rdparty/SimplePie/library/SimplePie/gzdecode.php | 2 +- js/settings.js | 5 +- 34 files changed, 229 insertions(+), 66 deletions(-) diff --git a/3rdparty/SimplePie/autoloader.php b/3rdparty/SimplePie/autoloader.php index 9fb7be586..c16a8f8b5 100644 --- a/3rdparty/SimplePie/autoloader.php +++ b/3rdparty/SimplePie/autoloader.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie.php b/3rdparty/SimplePie/library/SimplePie.php index 5042f6b1a..b33c635f1 100644 --- a/3rdparty/SimplePie/library/SimplePie.php +++ b/3rdparty/SimplePie/library/SimplePie.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -50,7 +50,7 @@ define('SIMPLEPIE_NAME', 'SimplePie'); /** * SimplePie Version */ -define('SIMPLEPIE_VERSION', '1.3'); +define('SIMPLEPIE_VERSION', '1.3.1'); /** * SimplePie Build @@ -636,7 +636,19 @@ class SimplePie if (func_num_args() > 0) { - trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_location() directly.'); + $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; + trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_location() directly.', $level); + + $args = func_get_args(); + switch (count($args)) { + case 3: + $this->set_cache_duration($args[2]); + case 2: + $this->set_cache_location($args[1]); + case 1: + $this->set_feed_url($args[0]); + $this->init(); + } } } @@ -1263,7 +1275,7 @@ class SimplePie // Decide whether to enable caching if ($this->cache && $parsed_feed_url['scheme'] !== '') { - $cache = $this->registry->call('Cache', 'create', array($this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc')); + $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc')); } // Fetch the data via SimplePie_File into $this->raw_data @@ -1500,10 +1512,20 @@ class SimplePie { // We need to unset this so that if SimplePie::set_file() has been called that object is untouched unset($file); - if (!($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))) + try + { + if (!($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))) + { + $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed."; + $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); + return false; + } + } + catch (SimplePie_Exception $e) { - $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed."; - $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); + // This is usually because DOMDocument doesn't exist + $this->error = $e->getMessage(); + $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, $e->getFile(), $e->getLine())); return false; } if ($cache) @@ -1513,7 +1535,7 @@ class SimplePie { trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); } - $cache = $this->registry->call('Cache', 'create', array($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc')); + $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc')); } $this->feed_url = $file->url; } @@ -2901,6 +2923,65 @@ class SimplePie } } + /** + * Set the favicon handler + * + * @deprecated Use your own favicon handling instead + */ + public function set_favicon_handler($page = false, $qs = 'i') + { + $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; + trigger_error('Favicon handling has been removed, please use your own handling', $level); + return false; + } + + /** + * Get the favicon for the current feed + * + * @deprecated Use your own favicon handling instead + */ + public function get_favicon() + { + $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; + trigger_error('Favicon handling has been removed, please use your own handling', $level); + + if (($url = $this->get_link()) !== null) + { + return 'http://g.etfv.co/' . urlencode($url); + } + + return false; + } + + /** + * Magic method handler + * + * @param string $method Method name + * @param array $args Arguments to the method + * @return mixed + */ + public function __call($method, $args) + { + if (strpos($method, 'subscribe_') === 0) + { + $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; + trigger_error('subscribe_*() has been deprecated, implement the callback yourself', $level); + return ''; + } + if ($method === 'enable_xml_dump') + { + $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; + trigger_error('enable_xml_dump() has been deprecated, use get_raw_data() instead', $level); + return false; + } + + $class = get_class($this); + $trace = debug_backtrace(); + $file = $trace[0]['file']; + $line = $trace[0]['line']; + trigger_error("Call to undefined method $class::$method() in $file on line $line", E_USER_ERROR); + } + /** * Sorting callback for items * diff --git a/3rdparty/SimplePie/library/SimplePie/Author.php b/3rdparty/SimplePie/library/SimplePie/Author.php index ac274ecbf..bbf3812ff 100644 --- a/3rdparty/SimplePie/library/SimplePie/Author.php +++ b/3rdparty/SimplePie/library/SimplePie/Author.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -154,3 +154,4 @@ class SimplePie_Author } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Cache.php b/3rdparty/SimplePie/library/SimplePie/Cache.php index 19c69362d..75586d749 100644 --- a/3rdparty/SimplePie/library/SimplePie/Cache.php +++ b/3rdparty/SimplePie/library/SimplePie/Cache.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -79,7 +79,7 @@ class SimplePie_Cache * @param string $extension 'spi' or 'spc' * @return SimplePie_Cache_Base Type of object depends on scheme of `$location` */ - public static function create($location, $filename, $extension) + public static function get_handler($location, $filename, $extension) { $type = explode(':', $location, 2); $type = $type[0]; @@ -92,6 +92,17 @@ class SimplePie_Cache return new SimplePie_Cache_File($location, $filename, $extension); } + /** + * Create a new SimplePie_Cache object + * + * @deprecated Use {@see get_handler} instead + */ + public function create($location, $filename, $extension) + { + trigger_error('Cache::create() has been replaced with Cache::get_handler(). Switch to the registry system to use this.', E_USER_DEPRECATED); + return self::get_handler($location, $filename, $extension); + } + /** * Register a handler * diff --git a/3rdparty/SimplePie/library/SimplePie/Cache/Base.php b/3rdparty/SimplePie/library/SimplePie/Cache/Base.php index a82b4cbe7..937e34631 100644 --- a/3rdparty/SimplePie/library/SimplePie/Cache/Base.php +++ b/3rdparty/SimplePie/library/SimplePie/Cache/Base.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Cache/DB.php b/3rdparty/SimplePie/library/SimplePie/Cache/DB.php index d6c7767ea..ac509ae08 100644 --- a/3rdparty/SimplePie/library/SimplePie/Cache/DB.php +++ b/3rdparty/SimplePie/library/SimplePie/Cache/DB.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Cache/File.php b/3rdparty/SimplePie/library/SimplePie/Cache/File.php index 8c2e171a3..5797b3aed 100644 --- a/3rdparty/SimplePie/library/SimplePie/Cache/File.php +++ b/3rdparty/SimplePie/library/SimplePie/Cache/File.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Cache/Memcache.php b/3rdparty/SimplePie/library/SimplePie/Cache/Memcache.php index d41886726..fd4478060 100644 --- a/3rdparty/SimplePie/library/SimplePie/Cache/Memcache.php +++ b/3rdparty/SimplePie/library/SimplePie/Cache/Memcache.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Cache/MySQL.php b/3rdparty/SimplePie/library/SimplePie/Cache/MySQL.php index 773194618..d53ebc117 100644 --- a/3rdparty/SimplePie/library/SimplePie/Cache/MySQL.php +++ b/3rdparty/SimplePie/library/SimplePie/Cache/MySQL.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Caption.php b/3rdparty/SimplePie/library/SimplePie/Caption.php index e8aa00381..52922c5d9 100644 --- a/3rdparty/SimplePie/library/SimplePie/Caption.php +++ b/3rdparty/SimplePie/library/SimplePie/Caption.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -207,3 +207,4 @@ class SimplePie_Caption } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Category.php b/3rdparty/SimplePie/library/SimplePie/Category.php index 7a5af892e..ad0407b4e 100644 --- a/3rdparty/SimplePie/library/SimplePie/Category.php +++ b/3rdparty/SimplePie/library/SimplePie/Category.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -154,3 +154,4 @@ class SimplePie_Category } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Content/Type/Sniffer.php b/3rdparty/SimplePie/library/SimplePie/Content/Type/Sniffer.php index b5ed9fb06..20d053dca 100644 --- a/3rdparty/SimplePie/library/SimplePie/Content/Type/Sniffer.php +++ b/3rdparty/SimplePie/library/SimplePie/Content/Type/Sniffer.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -329,3 +329,4 @@ class SimplePie_Content_Type_Sniffer return 'text/html'; } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Copyright.php b/3rdparty/SimplePie/library/SimplePie/Copyright.php index c52fcb760..57c535a64 100644 --- a/3rdparty/SimplePie/library/SimplePie/Copyright.php +++ b/3rdparty/SimplePie/library/SimplePie/Copyright.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -127,3 +127,4 @@ class SimplePie_Copyright } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Core.php b/3rdparty/SimplePie/library/SimplePie/Core.php index f2bba874d..46d996628 100644 --- a/3rdparty/SimplePie/library/SimplePie/Core.php +++ b/3rdparty/SimplePie/library/SimplePie/Core.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Credit.php b/3rdparty/SimplePie/library/SimplePie/Credit.php index 692f860c6..d3a3442ad 100644 --- a/3rdparty/SimplePie/library/SimplePie/Credit.php +++ b/3rdparty/SimplePie/library/SimplePie/Credit.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -153,3 +153,4 @@ class SimplePie_Credit } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Decode/HTML/Entities.php b/3rdparty/SimplePie/library/SimplePie/Decode/HTML/Entities.php index b06821394..069e8d8e5 100644 --- a/3rdparty/SimplePie/library/SimplePie/Decode/HTML/Entities.php +++ b/3rdparty/SimplePie/library/SimplePie/Decode/HTML/Entities.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -614,3 +614,4 @@ class SimplePie_Decode_HTML_Entities } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Enclosure.php b/3rdparty/SimplePie/library/SimplePie/Enclosure.php index d784c77c1..55674379c 100644 --- a/3rdparty/SimplePie/library/SimplePie/Enclosure.php +++ b/3rdparty/SimplePie/library/SimplePie/Enclosure.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -1377,3 +1377,4 @@ class SimplePie_Enclosure } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/File.php b/3rdparty/SimplePie/library/SimplePie/File.php index a5cf83eb6..b7d1a2ac9 100644 --- a/3rdparty/SimplePie/library/SimplePie/File.php +++ b/3rdparty/SimplePie/library/SimplePie/File.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/HTTP/Parser.php b/3rdparty/SimplePie/library/SimplePie/HTTP/Parser.php index ad33f72c1..bff2222b2 100644 --- a/3rdparty/SimplePie/library/SimplePie/HTTP/Parser.php +++ b/3rdparty/SimplePie/library/SimplePie/HTTP/Parser.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/IRI.php b/3rdparty/SimplePie/library/SimplePie/IRI.php index 012866da6..d3198c04f 100644 --- a/3rdparty/SimplePie/library/SimplePie/IRI.php +++ b/3rdparty/SimplePie/library/SimplePie/IRI.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -390,8 +390,8 @@ class SimplePie_IRI } else { - trigger_error('This should never happen', E_USER_ERROR); - die; + // This can occur when a paragraph is accidentally parsed as a URI + return false; } } @@ -824,6 +824,10 @@ class SimplePie_IRI else { $parsed = $this->parse_iri((string) $iri); + if (!$parsed) + { + return false; + } $return = $this->set_scheme($parsed['scheme']) && $this->set_authority($parsed['authority']) diff --git a/3rdparty/SimplePie/library/SimplePie/Item.php b/3rdparty/SimplePie/library/SimplePie/Item.php index bcf9ad686..a77574b37 100644 --- a/3rdparty/SimplePie/library/SimplePie/Item.php +++ b/3rdparty/SimplePie/library/SimplePie/Item.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -2961,3 +2961,4 @@ class SimplePie_Item } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Locator.php b/3rdparty/SimplePie/library/SimplePie/Locator.php index 07270cd37..57e910c22 100644 --- a/3rdparty/SimplePie/library/SimplePie/Locator.php +++ b/3rdparty/SimplePie/library/SimplePie/Locator.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -72,11 +72,18 @@ class SimplePie_Locator $this->timeout = $timeout; $this->max_checked_feeds = $max_checked_feeds; - $this->dom = new DOMDocument(); + if (class_exists('DOMDocument')) + { + $this->dom = new DOMDocument(); - set_error_handler(array('SimplePie_Misc', 'silence_errors')); - $this->dom->loadHTML($this->file->body); - restore_error_handler(); + set_error_handler(array('SimplePie_Misc', 'silence_errors')); + $this->dom->loadHTML($this->file->body); + restore_error_handler(); + } + else + { + $this->dom = null; + } } public function set_registry(SimplePie_Registry $registry) @@ -162,6 +169,10 @@ class SimplePie_Locator public function get_base() { + if ($this->dom === null) + { + throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); + } $this->http_base = $this->file->url; $this->base = $this->http_base; $elements = $this->dom->getElementsByTagName('base'); @@ -169,7 +180,12 @@ class SimplePie_Locator { if ($element->hasAttribute('href')) { - $this->base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base)); + $base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base)); + if ($base === false) + { + continue; + } + $this->base = $base; $this->base_location = method_exists($element, 'getLineNo') ? $element->getLineNo() : 0; break; } @@ -196,6 +212,11 @@ class SimplePie_Locator protected function search_elements_by_tag($name, &$done, $feeds) { + if ($this->dom === null) + { + throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); + } + $links = $this->dom->getElementsByTagName($name); foreach ($links as $link) { @@ -216,6 +237,10 @@ class SimplePie_Locator { $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); } + if ($href === false) + { + continue; + } if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href])) { @@ -238,6 +263,11 @@ class SimplePie_Locator public function get_links() { + if ($this->dom === null) + { + throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); + } + $links = $this->dom->getElementsByTagName('a'); foreach ($links as $link) { @@ -255,6 +285,10 @@ class SimplePie_Locator { $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); } + if ($href === false) + { + continue; + } $current = $this->registry->call('Misc', 'parse_url', array($this->file->url)); @@ -335,3 +369,4 @@ class SimplePie_Locator return null; } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Misc.php b/3rdparty/SimplePie/library/SimplePie/Misc.php index 33e0f966f..5d7367f64 100644 --- a/3rdparty/SimplePie/library/SimplePie/Misc.php +++ b/3rdparty/SimplePie/library/SimplePie/Misc.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -80,13 +80,11 @@ class SimplePie_Misc public static function absolutize_url($relative, $base) { $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative); - -//NOTE: this is temporary commented out to bypass issue #214: https://github.com/simplepie/simplepie/issues/214 - if ( is_object( $iri ) ) { - return $iri->get_uri(); - } else { - return FALSE; + if ($iri === false) + { + return false; } + return $iri->get_uri(); } /** @@ -277,9 +275,7 @@ class SimplePie_Misc */ public static function windows_1252_to_utf8($string) { - static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\ -xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\ -xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF"); + static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF"); return strtr($string, $convert_table); } @@ -2248,3 +2244,4 @@ function embed_wmedia(width, height, link) { // No-op } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Net/IPv6.php b/3rdparty/SimplePie/library/SimplePie/Net/IPv6.php index b9e4b35c9..da80d8aca 100644 --- a/3rdparty/SimplePie/library/SimplePie/Net/IPv6.php +++ b/3rdparty/SimplePie/library/SimplePie/Net/IPv6.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Parse/Date.php b/3rdparty/SimplePie/library/SimplePie/Parse/Date.php index 4645fcc91..d51f500d3 100644 --- a/3rdparty/SimplePie/library/SimplePie/Parse/Date.php +++ b/3rdparty/SimplePie/library/SimplePie/Parse/Date.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -980,3 +980,4 @@ class SimplePie_Parse_Date } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/Parser.php b/3rdparty/SimplePie/library/SimplePie/Parser.php index 47172d108..d698552ca 100644 --- a/3rdparty/SimplePie/library/SimplePie/Parser.php +++ b/3rdparty/SimplePie/library/SimplePie/Parser.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -278,8 +278,12 @@ class SimplePie_Parser if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['base'])) { - $this->xml_base[] = $this->registry->call('Misc', 'absolutize_url', array($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base))); - $this->xml_base_explicit[] = true; + $base = $this->registry->call('Misc', 'absolutize_url', array($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base))); + if ($base !== false) + { + $this->xml_base[] = $base; + $this->xml_base_explicit[] = true; + } } else { diff --git a/3rdparty/SimplePie/library/SimplePie/Rating.php b/3rdparty/SimplePie/library/SimplePie/Rating.php index d14eb6fa5..8689e5dfb 100644 --- a/3rdparty/SimplePie/library/SimplePie/Rating.php +++ b/3rdparty/SimplePie/library/SimplePie/Rating.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Registry.php b/3rdparty/SimplePie/library/SimplePie/Registry.php index 4fcd53c7b..1072cdebb 100755 --- a/3rdparty/SimplePie/library/SimplePie/Registry.php +++ b/3rdparty/SimplePie/library/SimplePie/Registry.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -203,6 +203,22 @@ class SimplePie_Registry { $class = $this->get_class($type); + if (in_array($class, $this->legacy)) + { + switch ($type) + { + case 'Cache': + // For backwards compatibility with old non-static + // Cache::create() methods + if ($method === 'get_handler') + { + $result = @call_user_func_array(array($class, 'create'), $parameters); + return $result; + } + break; + } + } + $result = call_user_func_array(array($class, $method), $parameters); return $result; } diff --git a/3rdparty/SimplePie/library/SimplePie/Restriction.php b/3rdparty/SimplePie/library/SimplePie/Restriction.php index 40ea17df7..4ba371bfb 100644 --- a/3rdparty/SimplePie/library/SimplePie/Restriction.php +++ b/3rdparty/SimplePie/library/SimplePie/Restriction.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/Sanitize.php b/3rdparty/SimplePie/library/SimplePie/Sanitize.php index 9e11357df..6810cc49f 100644 --- a/3rdparty/SimplePie/library/SimplePie/Sanitize.php +++ b/3rdparty/SimplePie/library/SimplePie/Sanitize.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -302,7 +302,7 @@ class SimplePie_Sanitize if ($img->hasAttribute('src')) { $image_url = call_user_func($this->cache_name_function, $img->getAttribute('src')); - $cache = $this->registry->call('Cache', 'create', array($this->cache_location, $image_url, 'spi')); + $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, $image_url, 'spi')); if ($cache->load()) { @@ -356,7 +356,11 @@ class SimplePie_Sanitize if ($type & SIMPLEPIE_CONSTRUCT_IRI) { - $data = $this->registry->call('Misc', 'absolutize_url', array($data, $base)); + $absolute = $this->registry->call('Misc', 'absolutize_url', array($data, $base)); + if ($absolute !== false) + { + $data = $absolute; + } } if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI)) @@ -412,7 +416,10 @@ class SimplePie_Sanitize if ($element->hasAttribute($attribute)) { $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base)); - $element->setAttribute($attribute, $value); + if ($value !== false) + { + $element->setAttribute($attribute, $value); + } } } } diff --git a/3rdparty/SimplePie/library/SimplePie/Source.php b/3rdparty/SimplePie/library/SimplePie/Source.php index 88837f08d..51d8e6c25 100644 --- a/3rdparty/SimplePie/library/SimplePie/Source.php +++ b/3rdparty/SimplePie/library/SimplePie/Source.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -608,3 +608,4 @@ class SimplePie_Source } } } + diff --git a/3rdparty/SimplePie/library/SimplePie/XML/Declaration/Parser.php b/3rdparty/SimplePie/library/SimplePie/XML/Declaration/Parser.php index a03f63a03..aec19f10a 100644 --- a/3rdparty/SimplePie/library/SimplePie/XML/Declaration/Parser.php +++ b/3rdparty/SimplePie/library/SimplePie/XML/Declaration/Parser.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/3rdparty/SimplePie/library/SimplePie/gzdecode.php b/3rdparty/SimplePie/library/SimplePie/gzdecode.php index 88cb07f3a..52e024ea9 100644 --- a/3rdparty/SimplePie/library/SimplePie/gzdecode.php +++ b/3rdparty/SimplePie/library/SimplePie/gzdecode.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.3 + * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon diff --git a/js/settings.js b/js/settings.js index 4d5956cbd..fff0e60a4 100644 --- a/js/settings.js +++ b/js/settings.js @@ -51,11 +51,8 @@ News.Settings={ }); }, exportOpml:function(button){ - $(button).attr("disabled", true); - $(button).prop('value', t('news', 'Downloading...')); document.location.href = OC.linkTo('news', 'opmlexporter.php'); - $(button).prop('value', t('news', 'Download')); - $(button).attr("disabled", false); + $('#appsettings_popup').remove(); } } -- cgit v1.2.3