]> git.wh0rd.org - tt-rss.git/commitdiff
move add_feed_url() to pref_feeds
authorAndrew Dolgov <noreply@fakecake.org>
Thu, 11 May 2017 06:07:49 +0000 (09:07 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Thu, 11 May 2017 06:07:49 +0000 (09:07 +0300)
classes/pref/feeds.php
include/functions.php
plugins/bookmarklets/init.php

index 78e0f2f2bf70ee1fe6d93d3f67eef8aabd0c5bc4..002d56aeb95fe5954d1a1fbf3eaa6634e7a6cc32 100755 (executable)
@@ -1489,7 +1489,7 @@ class Pref_Feeds extends Handler_Protected {
 
                        print "<button onclick='window.navigator.registerContentHandler(" .
                       "\"application/vnd.mozilla.maybe.feed\", " .
-                      "\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
+                      "\"" . $this->subscribe_to_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
                                                         __('Click here to register this site as a feed reader.') .
                                "</button>";
 
@@ -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
index 4801876c14a8777fd21181bdb651eb899c908d4e..3ea1035cb0050b3bf989d1b26e4e8945ccbd3631 100644 (file)
                }
        }
 
-       /**
-        * 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);
index 1ec4bbe9d277b75468c8150ffd23c0db96299cb8..14db3994a591b45aaef17f5e03b1efea7d780662 100644 (file)
@@ -21,7 +21,7 @@ class Bookmarklets extends Plugin {
 
                print "<p>" . __("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.") . "</p>";
 
-               $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?'));