diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3bf5b44e0e20bdc30dbef9c6b37d3e459f0c44c8..5367b8799ec0b1376750ba7fbbe8c567f266e52a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ Feeds 6.x 1.0 xxxxx xx, 2010-xx-xx ---------------------------------- +- #724184 ekes: catch failures when parsing for PubSubHubbub hub and self. - #706984 lyricnz: Add FeedsSimplePie::parseExtensions() to allow parsing to be customized. - #728854 Scott Reynolds: Fix $queue->createItem() fails. diff --git a/libraries/PuSHSubscriber.inc b/libraries/PuSHSubscriber.inc index 5a98b556c25a3bedd586352f43125fa22e7e92bb..39c3b6551e191731d3a73c08db8d0ef6d9c33b79 100644 --- a/libraries/PuSHSubscriber.inc +++ b/libraries/PuSHSubscriber.inc @@ -75,14 +75,17 @@ class PuSHSubscriber { curl_setopt($request, CURLOPT_RETURNTRANSFER, TRUE); $data = curl_exec($request); if (curl_getinfo($request, CURLINFO_HTTP_CODE) == 200) { - $xml = new SimpleXMLElement($data); - $xml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom'); - if (empty($hub) && $hub = @current($xml->xpath("//atom:link[attribute::rel='hub']"))) { - $hub = (string) $hub->attributes()->href; - } - if ($self = @current($xml->xpath("//atom:link[attribute::rel='self']"))) { - $self = (string) $self->attributes()->href; + try { + $xml = new SimpleXMLElement($data); + $xml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom'); + if (empty($hub) && $hub = @current($xml->xpath("//atom:link[attribute::rel='hub']"))) { + $hub = (string) $hub->attributes()->href; + } + if ($self = @current($xml->xpath("//atom:link[attribute::rel='self']"))) { + $self = (string) $self->attributes()->href; + } } + catch (Exception $e) {} } curl_close($request); // Fall back to $url if $self is not given.