* finish task #7986.

This commit is contained in:
z
2020-09-24 13:24:46 +08:00
parent be17c9d494
commit 2a6e021191
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1672,6 +1672,7 @@ EOD;
public static function getSysURL()
{
$httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strpos($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') $httpType = 'https';
$httpHost = $_SERVER['HTTP_HOST'];
return "$httpType://$httpHost";
}
+1 -1
View File
@@ -85,7 +85,7 @@ js::set('docID', $doc->id);
$url = $doc->content;
if(!preg_match('/^https?:\/\//', $doc->content)) $url = 'http://' . $url;
$urlIsHttps = strpos($url, 'https://') === 0;
$serverIsHttps = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on';
$serverIsHttps = ((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') or (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strpos($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'));
if(($urlIsHttps and $serverIsHttps) or (!$urlIsHttps and !$serverIsHttps))
{
echo "<iframe width='100%' id='urlIframe' src='$url'></iframe>";