diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Scrape.php | 27 | ||||
-rw-r--r-- | include/event.php | 7 | ||||
-rw-r--r-- | include/network.php | 7 |
3 files changed, 32 insertions, 9 deletions
diff --git a/include/Scrape.php b/include/Scrape.php index 642b8e624..f5b15c82f 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -30,8 +30,11 @@ function scrape_dfrn($url) { } } - - $dom = HTML5_Parser::parse($s); + try { + $dom = HTML5_Parser::parse($s); + } catch (DOMException $e) { + logger('scrape_dfrn: parse error: ' . $e); + } if(! $dom) return $ret; @@ -132,9 +135,11 @@ function scrape_meta($url) { } } - - - $dom = HTML5_Parser::parse($s); + try { + $dom = HTML5_Parser::parse($s); + } catch (DOMException $e) { + logger('scrape_meta: parse error: ' . $e); + } if(! $dom) return $ret; @@ -177,7 +182,11 @@ function scrape_vcard($url) { } } - $dom = HTML5_Parser::parse($s); + try { + $dom = HTML5_Parser::parse($s); + } catch (DOMException $e) { + logger('scrape_vcard: parse error: ' . $e); + } if(! $dom) return $ret; @@ -243,7 +252,11 @@ function scrape_feed($url) { } } - $dom = HTML5_Parser::parse($s); + try { + $dom = HTML5_Parser::parse($s); + } catch (DOMException $e) { + logger('scrape_feed: parse error: ' . $e); + } if(! $dom) return $ret; diff --git a/include/event.php b/include/event.php index 746422a13..c7669b381 100644 --- a/include/event.php +++ b/include/event.php @@ -53,7 +53,12 @@ function parse_event($h) { $ret = array(); - $dom = HTML5_Parser::parse($h); + + try { + $dom = HTML5_Parser::parse($h); + } catch (DOMException $e) { + logger('parse_event: parse error: ' . $e); + } if(! $dom) return $ret; diff --git a/include/network.php b/include/network.php index ec99d1e0d..c6f5fd909 100644 --- a/include/network.php +++ b/include/network.php @@ -429,7 +429,12 @@ function lrdd($uri) { // don't try and parse raw xml as html if(! strstr($html,'<?xml')) { require_once('library/HTML5/Parser.php'); - $dom = @HTML5_Parser::parse($html); + + try { + $dom = HTML5_Parser::parse($html); + } catch (DOMException $e) { + logger('lrdd: parse error: ' . $e); + } if($dom) { $items = $dom->getElementsByTagName('link'); |