Parcourir la source

if loaded over ssl and iframe is whitelisted, set its source to https

Andrew Dolgov il y a 9 ans
Parent
commit
c63850fad0
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      include/functions2.php

+ 6 - 1
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',