* Finish task #40817.

This commit is contained in:
holan20180123
2021-08-03 10:08:56 +08:00
parent 4c621f9f1e
commit 7a5f49acaa
+2 -1
View File
@@ -73,8 +73,9 @@ $sessionString .= session_name() . '=' . session_id();
{
$url = $doc->content;
if(!preg_match('/^https?:\/\//', $doc->content)) $url = 'http://' . $url;
$urlIsHttps = strpos($url, 'https://') === 0;
$urlIsHttps = strpos($url, 'https://') === 0;
$serverIsHttps = ((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') or (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'));
if(($urlIsHttps and $serverIsHttps) or (!$urlIsHttps and !$serverIsHttps))
{
echo "<iframe width='100%' id='urlIframe' src='$url'></iframe>";