Do not change feed links automatically at all

master
vitalif 2012-02-21 19:14:39 +00:00
parent 698c881ae8
commit 0541363f9d
1 changed files with 8 additions and 19 deletions

View File

@ -637,25 +637,14 @@ function fof_subscribe($user_id, $url, $unread = "today")
return array("Error: <b>" . $rss->error . "</b>", $feed);
else
{
$url = html_entity_decode($rss->subscribe_url(), ENT_QUOTES);
$self = $rss->get_link(0, 'self');
// Using <link rel="self"> as feed URL instead of user given URL is a fucking bad idea!
// Why? 1) handling broken feeds 2) handling authorized feeds 3) user knows URL better
//if($self) $url = html_entity_decode($self, ENT_QUOTES);
if (fof_feed_exists($url))
{
$feed = fof_db_get_feed_by_url($url);
if (fof_is_subscribed($user_id, $url))
return array("You are already subscribed to " . fof_render_feed_link($feed), $feed);
fof_db_add_subscription($user_id, $feed['feed_id']);
if ($unread != "no")
fof_db_mark_feed_unread($user_id, $feed['feed_id'], $unread);
return array('<font color="green"><b>Subscribed.</b></font>', $feed);
}
// Changing saved feed URL automatically is a fucking bad idea!
// It's very unpleasant to see that URL just changed sometime
// by itself because the remote site had an error and gave FOF
// some crap instead of real feed.
// The another problem is handling feeds with authorization data
// in the feed link: such feeds don't usually include login and
// password inside the 'self' link.
// So we don't change URLs in any way (original FOF did).
$id = fof_add_feed($url, rss_feed_title($rss), $rss->get_link(), $rss->get_description());