Magpie RSS

So I’ve used MagpieRss for quite sometime. First used happened a few years back when I did a little work customising my own version of TorrentFlux. Someone back then introduced me to Magpie which proved much easier than using my own XML parser.

Anyway since then it has been used in quite a few places to auto update sections of sites. One of the recent “bugs” I’ve come across is where it displays the message below from time to time.

Notice:  Undefined property:  etag in rss_fetch.inc on line 156

Anyway from the usual googling, there is more than one place that this type of message shows up. Annoying though is that this bug is fixed in the development version of Magpie and was actually fixed over two years ago.

Basic fix is to swap line 156

if( $rss and $rss->etag and $rss->last_modified) {

to

if ( $rss and (isset($rss->etag) and $rss->etag)
 and (isset($rss->last_modified) and $rss->last_modified) ) { 

On a side note, WordPress needs a nice way to handle code windows.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.