Hi,
I've just got 1.10.2 running on Zen 1.3.8a and all looked ok. However, spotted a problem happening which was reported earlier in this mammoth thread but the fixes suggested then applied to code which is now different.
Basically, the feed contained things like:
' where the first 5 characters there should actually be an ampersand
the Google Product Category line was coming out as...
<g:google_product_category>Arts &amp; Entertainment &gt; Party Supplies</g:google_product_category>
etc.
The relevant bit of code in includes/classes/google_base.php , in 1.10.2 anyway, is...
function google_base_sanita($str, $rt=false) {
//global $products;
$str = str_replace("\r\n", ' ', $str);
$str = strip_tags($str);
$str = preg_replace('/\s\s+/', ' ', $str);
if (phpversion() >= 5) $str = htmlspecialchars_decode($str);
$charset = '';
if (defined(CHARSET)) {
$charset = strtoupper(CHARSET);
}
$str = html_entity_decode($str, ENT_QUOTES, $charset);
$str = htmlentities($str, ENT_QUOTES, $charset);
return $str;
}
/*
function google_base_xml_sanitizer($str, $cdata = false) {
$str = $this->google_base_sanita($str);
$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))) && ($current > 10) ) {
$out .= chr($current);
} else {
$out .= " ";
}
}
$str = trim($str);
if ($cdata) {
$str = '<![CDATA[' . $str . ']]>';
}
return $str;
}*/
function google_base_xml_sanitizer($str, $products_id = '') { // products id added for debugging purposes
$str = $this->google_base_sanita($str);
$strout = null;
for ($i = 0; $i < strlen($str); $i++) {
$ord = ord($str[$i]);
if (($ord > 0 && $ord < 32) || ($ord >= 127)) {
$strout .= "&#{$ord};";
}
else {
switch ($str[$i]) {
case '<':
$strout .= '<';
break;
case '>':
$strout .= '>';
break;
case '&':
$strout .= '&';
break;
case '"':
$strout .= '"';
break;
default:
$strout .= $str[$i];
}
}
}
return $strout;
}
There are 2 versions of the function google_base_xml_sanitizer , one commented out. Swapping which was commented out made it work correctly for me. Not sure if there are any other implications mind you! Just posting this in case it's any use for anyone else.





