Okay, here’s what I’ve got at this point:
http://www.staze.org/static/fixwerss.php
This allows google reader to work…
All I’m doing is reading in the RSS line by line, and looking for any line that has in it, and then replacing any & with &
foreach($feed_array as $line) {
if(preg_match("",$line)) {
$fixed = preg_replace("/&/", "&", $line);
} elseif (preg_match("<title>",$line)) {
$fixed = preg_replace("/&/", "&", $line);
} else {
$fixed = $line;
}
echo $fixed;
}
I was also trying to fix the & in the field, but it doesn’t seem to be working, but on the positive side, that doesn’t seem to be breaking google reader.
Whole code is here:
[code]<?php
header('Content-Type: text/xml; charset=UTF-8');
function get_url_contents($url) {
//echo $url;
$crl = curl_init();
$timeout = 5;
curl_setopt ($crl, CURLOPT_URL, $url);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt ($crl, CURLOPT_HEADER, 0);
curl_setopt ($crl, CURLOPT_USERAGENT, "Mozilla/4.0");
$ret = curl_exec($crl);
curl_close($crl);
return $ret;
}
$url = 'http://www.wickededgeusa.com/index.php?option=com_kunena&func=rss&Itemid=63';
$feed = get_url_contents($url);
$feed_array = explode("r", $feed);
//print_r($feed);
foreach($feed_array as $line) {
if(preg_match("“,$line)) {
$fixed = preg_replace(”/&/“, “&”, $line);
} elseif (preg_match(”“,$line)) {
$fixed = preg_replace(”/&/", “&”, $line);
} else {
$fixed = $line;
}
echo $fixed;
}
?>[/code]