diff options
author | Andrew Dolgov <[email protected]> | 2013-07-10 12:50:42 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-07-10 12:50:42 +0400 |
commit | 0156128702a7477c6a2f725fa6bf24c66952aa48 (patch) | |
tree | fd9790953d2f0e40e5a5a2ef2419f7cda66c03cd | |
parent | cf1cd5a0e9fa1c4b9338414b4501ec21b55e2cea (diff) |
catch warning when removing source element
-rw-r--r-- | classes/feeditem/common.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/classes/feeditem/common.php b/classes/feeditem/common.php index f8fd3c62a..58065b198 100644 --- a/classes/feeditem/common.php +++ b/classes/feeditem/common.php @@ -9,11 +9,16 @@ abstract class FeedItem_Common extends FeedItem { $this->xpath = $xpath; $this->doc = $doc; - $source = $elem->getElementsByTagName("source")->item(0); + try { - // we don't need <source> element - if ($source) - $elem->removeChild($source); + $source = $elem->getElementsByTagName("source")->item(0); + + // we don't need <source> element + if ($source) + $elem->removeChild($source); + } catch (DOMException $e) { + // + } } function get_author() { |