Commit 4d372ebd authored by Chris Graham's avatar Chris Graham

Fixed MANTIS-3946

parent 50a42287
......@@ -174,6 +174,7 @@ class Hook_addon_registry_syndication
$cloud = do_lorem_template('RSS_CLOUD', array(
'TYPE' => 'news',
'DOMAIN' => 'example.com',
'PORT' => '80',
'LOCAL_BASE_URL' => placeholder_url(),
), null, false, null, '.xml', 'xml');
......
......@@ -209,24 +209,12 @@ function rss_backend_script()
if ($type == 'RSS2') {
// Change a full url into constituent parts
$base_url = get_base_url();
$port = 80;
$end_protocol_pos = strpos($base_url, '://');
$colon_pos = strpos($base_url, ':', $end_protocol_pos + 1);
if ($colon_pos !== false) {
$after_port_pos = strpos($base_url, '/', $colon_pos);
if ($after_port_pos === false) {
$after_port_pos = strlen($base_url);
}
$port = intval(substr($base_url, $colon_pos, $after_port_pos - $colon_pos));
}
$start_path_pos = strpos($base_url, '/', $end_protocol_pos + 4);
if ($start_path_pos !== false) {
$local_base_url = substr($base_url, $start_path_pos);
} else {
$local_base_url = '';
}
$url_bits = parse_url($base_url);
$domain = isset($url_bits['host']) ? $url_bits['host'] : $_SERVER['HTTP_HOST'];
$port = isset($url_bits['port']) ? $url_bits['port'] : 80;
$local_base_url = isset($url_bits['path']) ? $url_bits['path'] : '';
$rss_cloud = do_template('RSS_CLOUD', array('_GUID' => 'a47c40a4c137ea1e5abfc71346547313', 'TYPE' => ($type == 'news') ? '' : $type, 'PORT' => strval($port), 'LOCAL_BASE_URL' => $local_base_url), null, false, null, '.xml', 'xml');
$rss_cloud = do_template('RSS_CLOUD', array('_GUID' => 'a47c40a4c137ea1e5abfc71346547313', 'TYPE' => ($type == 'news') ? '' : $type, 'PORT' => strval($port), 'DOMAIN' => $domain, 'LOCAL_BASE_URL' => $local_base_url), null, false, null, '.xml', 'xml');
} else {
$rss_cloud = new Tempcode();
}
......
{+START,IF,{$NOT,{$BROWSER_MATCHES,itunes}}}
<cloud domain="{$DOMAIN*}" port="{PORT*}" path="{LOCAL_BASE_URL*}/backend_cloud.php?type={TYPE*}" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc" />
<cloud domain="{DOMAIN*}" port="{PORT*}" path="{LOCAL_BASE_URL*}/backend_cloud.php?type={TYPE*}" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc" />
{+END}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment