]> git.wh0rd.org Git - tt-rss.git/commitdiff
some is_array() sanity checks for content (possible fix for #49)
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 18 Mar 2006 15:35:57 +0000 (16:35 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 18 Mar 2006 15:35:57 +0000 (16:35 +0100)
functions.php

index 18546ca18bebf7ab2442538cad9b483db372b881..f9f024cbcc34d579cddfb3a5fe039432d5b12ca8 100644 (file)
 
                        $iterator = $rss->items;
 
-                       if (!$iterator) $iterator = $rss->entries;
-                       if (!$iterator) $iterator = $rss;                       
+                       if (!$iterator || !is_array($iterator)) $iterator = $rss->entries;
+                       if (!$iterator || !is_array($iterator)) $iterator = $rss;
+
+                       if (!is_array($iterator)) {
+                               return; // WTF?
+                       }
 
                        foreach ($iterator as $item) {