I'm just started to use simplepie an I am very pleased with its functionalities.
Nice job. You have saved me from "reinventing the wheel".
So I have refactored my little app to use simplepie but I have encountered o small bug related to enclosures...
On zero enclosures the $item->get_enclosures() method returns:
It should return:
( or maybe an empty array() ? )
I use PHP Version 5.5.9-1ubuntu4.17.
As a temporary measure I had to comment (in item.php) this piece of code line ~2880:
if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
$this->data['enclosures'] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
hi @florinj, something must be set in the lines you've commented out, otherwise the assignment wouldn't happen and the function would return null as you've suggested. $restrictions_parent looks like the obvious candidate for what's causing your problem here.