aboutsummaryrefslogtreecommitdiffstats
path: root/lib/simplepie/library/SimplePie/Locator.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/simplepie/library/SimplePie/Locator.php')
-rw-r--r--lib/simplepie/library/SimplePie/Locator.php21
1 files changed, 14 insertions, 7 deletions
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(