]> git.wh0rd.org Git - tt-rss.git/commitdiff
apply https bugfix from Frank De Meulenaere
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 24 Feb 2008 12:18:08 +0000 (13:18 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 24 Feb 2008 12:18:08 +0000 (13:18 +0100)
functions.php
modules/pref-feeds.php

index 06d7e7a74c60bb22786fab37b87e91125cd6d830..ae6e0f8e3d07741f5b682f9d1859f949ce50ab95 100644 (file)
 
        function article_publish_url($link) {
 
-               $url_path = 'http://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+               $url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' :  'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
 
                $url_path .= "?op=publish&key=" . get_pref($link, "_PREFS_PUBLISH_KEY");
 
         * @return string The Mozilla Firefox feed adding URL.
         */
        function add_feed_url() {
-               $url_path = 'http://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+               $url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' :  'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
                $url_path .= "?op=pref-feeds&quiet=1&subop=add&feed_url=%s";
                return $url_path;
        } // function add_feed_url
index ff9243912ba0f86b46145f8d8ea0fe916f799046..854ca0dc2adebbacfc6d095aa02974aa8c64d8a2 100644 (file)
                                }
 
                                if ($p_from != 'tt-rss') {
-                                       $tt_uri = 'http://' . $_SERVER['SERVER_NAME'] . 
-                                               preg_replace('/backend\.php.*$/', 
-                                                       'tt-rss.php', $_SERVER["REQUEST_URI"]);
+                                       $tt_uri = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'tt-rss.php', $_SERVER["REQUEST_URI"]);
 
-                                       $tp_uri = 'http://' . $_SERVER['SERVER_NAME'] . 
-                                               preg_replace('/backend\.php.*$/', 
-                                                       'prefs.php', $_SERVER["REQUEST_URI"]);
+
+                                       $tp_uri = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'prefs.php', $_SERVER["REQUEST_URI"]);
 
                                        print "<p><a href='$tt_uri'>Return to Tiny Tiny RSS</a> |";