]> git.wh0rd.org - tt-rss.git/commitdiff
if loaded over ssl and iframe is whitelisted, set its source to https
authorAndrew Dolgov <noreply@fakecake.org>
Sat, 6 Dec 2014 05:52:43 +0000 (08:52 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sat, 6 Dec 2014 05:52:43 +0000 (08:52 +0300)
include/functions2.php

index 29594076c1c6baaac8fc87560a41652863b269c8..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',