WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] RSS 2 Stopped working (7 posts)

  1. mindbash
    Member
    Posted 8 years ago #

    I've had my 1.5.2 installation up and running for two days now. Tonight the RSS 2.0 feed stopped working.

    "Reference to undefined entity 'raquo'. Error processing resource 'http://www.load.se/feed/'. Line 10, Position 15"

    Apparently it is getting upset by html special characters. They have been there all along and it has not been a problem earlier. I have played around and it gets angry by other special characters as well.

    I haven't done anything to the character encoding (im sticking to UTF-8 and hopes that my swedish writing will survive it :) ).

    It also seems that the rss-feed is cached somewhere. If i try removing some of the special chars i still get the same message - with the original document/database entry obviously changed.

    Help?

  2. mindbash
    Member
    Posted 8 years ago #

    Well, i solved this one myself. Google should be the first try even at 4 in the morning :)

    To anyone else experiencing this:

    Apparently RSS only like a very limited number of special characters. Using feedvalidator it gave me the reason for it failing and suggestions on how to fix it. Now i replaced all the special chars (like å   etc) with their numerical equivalences - and it works as a charm.

    However - i still can't work out why it has been working for two days :)

  3. Kafkaesqui

    Posted 8 years ago #

    I would call this a bug.

    The elements causing this in your feed relate to data displayed by the bloginfo_rss() tag. WordPress is supposed to filter this through the ent2ncr() function, which translates a HTML entity (») to its numeric equivalent (»). That's to avoid just the conflict you've come across. However bloginfo_rss() is lacking a filter hook, which means nothing is converted.

    I'll report the bug, but you can fix this in your WordPress source by editing feed-functions.php (under wp-includes/), locating the bloginfo_rss() function at the top of the file:

    function bloginfo_rss($show = '') {
    echo get_bloginfo_rss($show);
    }

    and changing it to:

    function bloginfo_rss($show = '') {
    $info = get_bloginfo_rss($show);
    $info = apply_filters('bloginfo_rss', $info, $show);
    echo $info;
    }

    "It also seems that the rss-feed is cached somewhere."

    That would be a feature of your browser. Perform a hard refresh on feed *pages* to reload.

  4. mindbash
    Member
    Posted 8 years ago #

    One would expect such filtering help. But i was accepting that my non-standard coding wasn't working :)

    Thank you for the help. I applied the fix and hope that future code adjustments will rock with RSS.

  5. brianmof
    Member
    Posted 8 years ago #

    I did this little fix and it seemed to solve my problem but then it reverted back to a situation where I had no rss feed

  6. ankursmart
    Member
    Posted 8 years ago #

    I applied this fix too, but it cannot solve my problem for rss ver. 0.92 though rss2 is working fine. It's breaking at the HTML special character "&".

  7. ankursmart
    Member
    Posted 8 years ago #

    Ok, I solved the problem by applying this fix:

    Change function : get_bloginfo_rss in wp-includes/feed-functions.php

    function get_bloginfo_rss($show = '') {
    $info = strip_tags(get_bloginfo($show));
    return convert_chars($info);
    }

    to :

    function get_bloginfo_rss($show = '') {
    $info = ent2ncr(strip_tags(get_bloginfo($show)));
    return convert_chars($info);
    }

Topic Closed

This topic has been closed to new replies.

About this Topic