/ * feedvalidator.org (Feedburner recommends this site to validate your feeds) says: "For the widest interop, the RSS Profile recommends the use of the hexadecimal character reference" & "to represent" & "and" <"to represent" < ". * /
// find title problems $find[] = '<'; $find[] = '\x92'; $find[] = '\x84'; // find content problems $find_c[] = '\x92'; $find_c[] = '\x84'; $find_c[] = ' '; // replace title $replace[] = '<'; $replace[] = '''; $replace[] = '"'; // replace content $replace_c[] = '''; $replace_c[] = '"'; $replace_c[] = ' '; // We don't want to re-replace "&" characters. // So do this first because of PHP "feature" https://bugs.php.net/bug.php?id=33773 $title = str_replace('&', '&
Of course I do preprocessing until $ title, $ post_content and $ link are added to my database. But this should help solve some common problems in order to get reliable RSS feed.
Update: Fixed the & # x26; # x26; # x26; "recursion" problem, see https://bugs.php.net/bug.php?id=33773
source share