Skip to content

Commit

Permalink
Merge pull request #1993 from ned3y2k/fix/image-component-ssl
Browse files Browse the repository at this point in the history
Fix/image component ssl
  • Loading branch information
bnu authored Jun 26, 2017
2 parents d0c9931 + 77e8e73 commit dfa9c1e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions modules/editor/components/image_link/image_link.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,22 @@ function transHTML($xml_obj)
$src = str_replace(array('&','"'), array('&','&qout;'), $src);
$src = str_replace('&', '&', $src);

$sslPort = Context::get('_https_port');
$sslPort = $sslPort != '443' ? ':'.$sslPort : '';

// Image containing the address to the address conversion request uri (rss output, etc. purposes)
$temp_src = explode('/', $src);
if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2);
else if(substr($src , 0, 1)=='/')
{
if($_SERVER['HTTPS']=='on') $http_src = 'https://';
else $http_src = 'http://';
$src = $http_src.$_SERVER['HTTP_HOST'].$src;
if($_SERVER['HTTPS']=='on') {
$http_src = 'https://';
$src = $http_src.$_SERVER['HTTP_HOST'].$sslPort.$src;
} else {
$http_src = 'http://';
$src = $http_src.$_SERVER['HTTP_HOST'].$src;
}

}
else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src;

Expand Down

0 comments on commit dfa9c1e

Please sign in to comment.