summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2014-12-06 08:52:43 +0300
committerAndrew Dolgov <[email protected]>2014-12-06 08:52:43 +0300
commitc63850fad00f228ae9613d8f662dd4d2ff05e528 (patch)
tree392db878db03dfe5664a4f719af7cc06332739d8 /include
parentbd076268264c2b57d9fb26baf818b7524d7306f9 (diff)
if loaded over ssl and iframe is whitelisted, set its source to https
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/functions2.php b/include/functions2.php
index 29594076c..31ca98035 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -911,8 +911,13 @@
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',