From: Andrew Dolgov Date: Thu, 17 Jan 2008 05:45:55 +0000 (+0100) Subject: simplepie: check whether enclosures array is defined before parsing X-Git-Tag: 1.2.19~3 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3b9e5af4b93279926c27a1c9c19b223b93ba0cea;p=tt-rss.git simplepie: check whether enclosures array is defined before parsing --- diff --git a/functions.php b/functions.php index b445ab67..a5da7b0b 100644 --- a/functions.php +++ b/functions.php @@ -859,7 +859,7 @@ $additional_tags = array(); $additional_tags_src = $item->get_categories(); - + if (is_array($additional_tags_src)) { foreach ($additional_tags_src as $tobj) { array_push($additional_tags, $tobj->get_term()); @@ -919,11 +919,13 @@ if (ENABLE_SIMPLEPIE) { $encs = $item->get_enclosures(); - foreach ($encs as $e) { - $e_item = array( - $e->link, $e->type, $e->length); - - array_push($enclosures, $e_item); + if (is_array($encs)) { + foreach ($encs as $e) { + $e_item = array( + $e->link, $e->type, $e->length); + + array_push($enclosures, $e_item); + } } } else {