willvincent / feeds

A simple Laravel service provider for including the SimplePie library.
MIT License
309 stars 76 forks source link

Recursion detected #58

Closed nexxai closed 5 years ago

nexxai commented 5 years ago

Ok so I'm probably just an idiot but for the life of me, I cannot figure out how to make this thing go.

I've tried two different feeds (http://www.playbill.com/rss/news and https://www.broadway.com/feeds/buzz/latest/) but when I do this in my controller with either feed:

$feed = Feeds::make('https://www.broadway.com/feeds/buzz/latest/');

$data = array(
    'title' => $feed->get_title(),
    'permalink' => $feed->get_permalink(),
    'items' => $feed->get_items(),
);
return $data;

I get the error "InvalidArgumentException - Recursion detected"

If I remove this line: 'items' => $feed->get_items(), it displays the title and permalink just fine.

Right now, I don't want to do anything with the feeds other than confirm they're working and displaying the contents in plaintext; once I know it's actually working, I will work on returning a proper view, etc.

What am I missing here?

nexxai commented 5 years ago

Turns out that I'm definitely an idiot because when I created the view and just did a foreach loop, it worked fine. What I'm now having trouble with is the HTML included in some of the feeds. I have the default settings in the config/feeds.php, but what I'm finding is that even base/common tags like "

" are being echoed out as text rather than being interpreted. I'm assuming this is Laravel trying to protect me from someone including some nasty/exploitable HTML in the feed source, but I don't know how to tell it that I am ok with those risks.

nexxai commented 5 years ago

And I figured out {!! !!} will fix that. I think I'm done here.

Thanks for the great package!