// See http://sourceforge.net/p/feedvalidator/bugs/72/
$http_url = preg_replace("/^https/", "http", $url);
// See http://sourceforge.net/p/feedvalidator/bugs/72/
$http_url = preg_replace("/^https/", "http", $url);
$stylesheet = "file://" . __DIR__ . "/rss_converter_" . $host . ".xsl";
if (FALSE === file_exists($stylesheet)) {
trigger_error("Conversion to RSS not supported for $host ($stylesheet not found)", E_USER_ERROR);
return NULL;
}
$stylesheet = "file://" . __DIR__ . "/rss_converter_" . $host . ".xsl";
if (FALSE === file_exists($stylesheet)) {
trigger_error("Conversion to RSS not supported for $host ($stylesheet not found)", E_USER_ERROR);
return NULL;
}
$xslDoc = new DOMDocument();
$xslDoc->loadXML($stylesheet_contents);
$xsltProcessor = new XSLTProcessor();
$xsltProcessor->registerPHPFunctions();
$xslDoc = new DOMDocument();
$xslDoc->loadXML($stylesheet_contents);
$xsltProcessor = new XSLTProcessor();
$xsltProcessor->registerPHPFunctions();
// Apparently the ObjectNormalizer used afterwards is not able to handle
// the stdClass object created by json_decode() with the default setting
// $assoc = false; so use $assoc = true.
// Apparently the ObjectNormalizer used afterwards is not able to handle
// the stdClass object created by json_decode() with the default setting
// $assoc = false; so use $assoc = true.
// Strip the leading www. to be more forgiving on input URLs.
$host = preg_replace('/^www\./', '', $url["host"]);
// Strip the leading www. to be more forgiving on input URLs.
$host = preg_replace('/^www\./', '', $url["host"]);