* finish task #7986.
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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>";
|
||||
|
||||
Reference in New Issue
Block a user