Invalid RSS-Feed from MyCalendar plugin

Found a bug? Tell us!!
Post Reply
gegenglueck
Posts: 4
Joined: Fri Feb 26, 2010 3:33 pm

Invalid RSS-Feed from MyCalendar plugin

Post by gegenglueck »

I'm using Serendipity 1.5.5 (PHP 5.2.12-nmm2), MyCalendar plugin, vers. 0.13., for a blog at http://gegenglueck.org (calender at top of left menubar)

The following link works for displaying on the page:
http://kampnagel.de/index.php?page=deta ... ter=657814
but messes up the feed (the entry isn't visible in FF but still in source):
http://gegenglueck.org/plugin/mycalendar.rss
My feedreader (http://rsslounge.aditu.de/) also complains:
* gegenglueck - Mein Kalender
* XML error: EntityRef: expecting ';' at line 26, column 60

Probably the reason is the ampersand within the link - any idea what todo about it?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Invalid RSS-Feed from MyCalendar plugin

Post by garvinhicking »

Hi!

XML is not forgiving for XHTML formatting errors. Specifically:

kampnagel.de/index.php?page=detail&cluster=657814

is not valid, you need to use:

kampnagel.de/index.php?page=detail&cluster=657814

Does that help?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gegenglueck
Posts: 4
Joined: Fri Feb 26, 2010 3:33 pm

Re: Invalid RSS-Feed from MyCalendar plugin

Post by gegenglueck »

Moin Garvin,

I've tried it before (and again right now, if you want to test), but than it's a slightly different problem: The feed as such and the link in feed title is valid, but the link in the sidebar and in feed body is wrong / not working with the modified ampersand.

For just this single case, I wouldn't mind, but as an ampersand in links is quite common (like for links to this post), it's a more general issue with the plugin. I'm willing to help with testing or modifying my site, but unfortunately my coding abilities are limited.

Regards,
gegenglueck
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Invalid RSS-Feed from MyCalendar plugin

Post by garvinhicking »

Hi!

Ah, of course you're right. Now I see the issue.

Can you edit your serendipity_event_mycalender.php file? Search for this code:

Code: Select all

<item>
    <title><?php echo serendipity_utf8_encode($item['title']); ?></title>
    <link><?php echo serendipity_utf8_encode($item['url']); ?></link>
    <author><?php echo $serendipity['blogTitle']; ?></author>
    <content:encoded>
    <?php echo serendipity_utf8_encode(htmlspecialchars($item['content'])); ?>
    </content:encoded>
    <pubDate><?php echo $item['date']; ?></pubDate>
    <guid isPermaLink="false"><?php echo serendipity_utf8_encode($item['url']); ?></guid>
</item>
and replace that with:

Code: Select all

<item>
    <title><?php echo serendipity_utf8_encode(htmlspecialchars($item['title'])); ?></title>
    <link><?php echo serendipity_utf8_encode(htmlspecialchars($item['url'])); ?></link>
    <author><?php echo $serendipity['blogTitle']; ?></author>
    <content:encoded>
    <?php echo serendipity_utf8_encode(htmlspecialchars($item['content'])); ?>
    </content:encoded>
    <pubDate><?php echo $item['date']; ?></pubDate>
    <guid isPermaLink="false"><?php echo serendipity_utf8_encode(htmlspecialchars($item['url'])); ?></guid>
</item>
This adds htmlspecialchars() to important place - please tell me if it works then, and you can keep the "native" & in your links :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gegenglueck
Posts: 4
Joined: Fri Feb 26, 2010 3:33 pm

Re: Invalid RSS-Feed from MyCalendar plugin

Post by gegenglueck »

I've done what you told me and - tataa - all links in the sidebar and the feed (title and body) are working fine. So from my point of view the issue seems to be solved/fixed.

Thanks a lot (and not only for the fix, the whole software is great),
gegenglueck
Post Reply