]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions2.php
night theme: add workaround for grayscale filter not working on firefox, other minor...
[tt-rss.git] / include / functions2.php
index 866c92ec90b0a3931d753c33ebbdc7b4a70be86e..31ca98035e953b87fb940a733d4dd68a42c94200 100644 (file)
                foreach ($entries as $entry) {
                        if (!iframe_whitelisted($entry)) {
                                $entry->setAttribute('sandbox', 'allow-scripts');
+                       } else {
+                               if ($_SERVER['HTTPS'] == "on") {
+                                       $entry->setAttribute("src",
+                                               str_replace("http://", "https://",
+                                                       $entry->getAttribute("src")));
+                               }
                        }
-
                }
 
                $allowed_elements = array('a', 'address', 'audio', 'article', 'aside',
        }
 
        function getLastArticleId() {
-               $result = db_query("SELECT MAX(ref_id) AS id FROM ttrss_user_entries
-                       WHERE owner_uid = " . $_SESSION["uid"]);
+               $result = db_query("SELECT ref_id AS id FROM ttrss_user_entries
+                       WHERE owner_uid = " . $_SESSION["uid"] . " ORDER BY ref_id DESC LIMIT 1");
 
                if (db_num_rows($result) == 1) {
                        return db_fetch_result($result, 0, "id");