Anyone that is receiving data feed errors after upgrading to 1.7.1 please read:
As best I can tell, there was a shift in how special characters are handled in the includes/classes/googlebase.php file. Around line 169 there is a function called "google_base_xml_sanitizer".
I copied over some of the older scripting that
did work for me and now my function looks like this:
Code:
function google_base_xml_sanitizer($str, $cdata = false) {
$_strip_search = array("![\t ]+$|^[\t ]+!m",'%[\r\n]+%m'); // remove CRs and newlines
$_strip_replace = array('',' ');
$_cleaner_array = array(">" => "> ", "®" => "", "®" => "", "™" => "", "™" => "", "\t" => "", " " => "");
$str = html_entity_decode($str);
$str = strtr($str, $_cleaner_array);
$str = preg_replace($_strip_search, $_strip_replace, $str);
$str = strip_tags($str);
$str = eregi_replace("[^[:alnum:][:space:].,!()'-_/+=?äÂÄöÖüÜß]", "", $str);
$str = utf8_encode(htmlentities($str));
$str = str_replace('&', '&', $str);
$str = str_replace(array("®", "©", "™"), array('(r)', '(c)', '(tm)'), $str);
$out = "";
$length = strlen($str);
for ($i = 0; $i < $length; $i++) {
$current = ord($str{$i});
if (($current == 0x9) || ($current == 0xA) || ($current == 0xD) || (($current >= 0x20) && ($current <= 0xD7FF)) || (($current >= 0xE000) && ($current <= 0xFFFD)) || (($current >= 0x10000) && ($current <= 0x10FFFF))) {
$out .= chr($current);
} else {
$out .= " ";
}
}
$str = trim($out);
$str = str_replace(array("<", ">"), array("<", ">"), $str);
if ($cdata) {
$str = '<![CDATA[' . $str . ']]>';
}
return $str;
}
It's a little bit of a hack job but it works for me. I hope the author will see this and look into it because I love this addon!
Remember to make a copy before you make any changes to googlebase.php. And well, if it doesn't work .. I don't know what to tell you since I didn't write the script!
Note: One thing I noticed is that after making this change, my rss feeds seem to lose their HTML formatting. It's not crucial for me, and I'm not 100% certain that Base even allows it. So I may just be confusing myself here.

Bookmarks