From: Andrew Dolgov Date: Tue, 18 Jan 2011 13:58:26 +0000 (+0300) Subject: properly handle multiple feed extraction in external subscription dialog X-Git-Tag: 1.5.1~2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=33d32a3c7ce98dc96e36a387640ff23017ac287a;p=tt-rss.git properly handle multiple feed extraction in external subscription dialog --- diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 7f1b029a..36957b23 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -930,17 +930,42 @@ case 0: print_warning(T_sprintf("Already subscribed to %s.", $feed_url)); break; + case 4: + print_notice("Multiple feed URLs found."); + + $feed_urls = get_feeds_from_html($feed_url); + break; case 5: print_error(T_sprintf("Could not subscribe to %s.
Can't download the Feed URL.", $feed_url)); break; } if ($p_from != 'tt-rss') { - if (!isset($_SERVER['HTTPS'])) $_SERVER['HTTPS'] = 'off'; - $tt_uri = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'tt-rss.php', $_SERVER["REQUEST_URI"]); + if ($feed_urls) { + + print "
"; + print ""; + print ""; + print ""; + + print ""; + + print "
"; + } - $tp_uri = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'prefs.php', $_SERVER["REQUEST_URI"]); + $tp_uri = get_self_url_prefix() . "/prefs.php"; + $tt_uri = get_self_url_prefix(); if ($rc <= 2){ $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE