]> git.wh0rd.org Git - tt-rss.git/commitdiff
simplepie: check whether enclosures array is defined before parsing
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 Jan 2008 05:45:55 +0000 (06:45 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 Jan 2008 05:45:55 +0000 (06:45 +0100)
functions.php

index b445ab6759b6fc7e3e7ac6d51410ecddc08c55ed..a5da7b0bba3ad0b26dcc5cee2d46559d72b13b62 100644 (file)
 
                                        $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());
                                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 {