From c114a2596f15bedafa0acae68e8d48ad336129c3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 May 2017 09:07:49 +0300 Subject: [PATCH] move add_feed_url() to pref_feeds --- classes/pref/feeds.php | 9 ++++++++- include/functions.php | 13 ------------- plugins/bookmarklets/init.php | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 78e0f2f2..002d56ae 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1489,7 +1489,7 @@ class Pref_Feeds extends Handler_Protected { print ""; @@ -1972,4 +1972,11 @@ class Pref_Feeds extends Handler_Protected { print (int) $this->dbh->fetch_result($result, 0, "num_inactive"); } + + static function subscribe_to_feed_url() { + $url_path = get_self_url_prefix() . + "/public.php?op=subscribe&feed_url=%s"; + return $url_path; + } + } \ No newline at end of file diff --git a/include/functions.php b/include/functions.php index 4801876c..3ea1035c 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1791,19 +1791,6 @@ } } - /** - * Compute the Mozilla Firefox feed adding URL from server HOST and REQUEST_URI. - * - * @return string The Mozilla Firefox feed adding URL. - */ - function add_feed_url() { - //$url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); - - $url_path = get_self_url_prefix() . - "/public.php?op=subscribe&feed_url=%s"; - return $url_path; - } // function add_feed_url - function encrypt_password($pass, $salt = '', $mode2 = false) { if ($salt && $mode2) { return "MODE2:" . hash('sha256', $salt . $pass); diff --git a/plugins/bookmarklets/init.php b/plugins/bookmarklets/init.php index 1ec4bbe9..14db3994 100644 --- a/plugins/bookmarklets/init.php +++ b/plugins/bookmarklets/init.php @@ -21,7 +21,7 @@ class Bookmarklets extends Plugin { print "

" . __("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.") . "

"; - $bm_subscribe_url = str_replace('%s', '', add_feed_url()); + $bm_subscribe_url = str_replace('%s', '', Pref_Feeds::subscribe_to_feed_url()); $confirm_str = str_replace("'", "\'", __('Subscribe to %s in Tiny Tiny RSS?')); -- 2.39.5