diff --git a/index.php b/index.php index 72ed1b8..4402b3b 100755 --- a/index.php +++ b/index.php @@ -276,6 +276,15 @@ exit; function gmi2html($capsule, $body, $lang, $urlgem, $favicon) { + if(isset($_SERVER['REQUEST_SCHEME'])) { + $scheme = $_SERVER['REQUEST_SCHEME']; + } + else if(isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) { + $scheme = 'https'; + } + else { + $scheme = 'http'; + } $title=''; $lines=array(); $tocs=array(); @@ -344,7 +353,7 @@ function gmi2html($capsule, $body, $lang, $urlgem, $favicon) case "=>": $lines[]='

'; $link = explode(' ', substr($line,3), 2); - $lines[] = ''.htmlentities(empty($link[1])?rawurldecode($link[0]):$link[1]).""; + $lines[] = ''.htmlentities(empty($link[1])?rawurldecode($link[0]):$link[1]).""; if(strpos($link[0], '://')===false && // relative image in_array(strtolower(substr($link[0],-4)),array('.jpg','.png','.gif','jpeg','webp')) ) $lines[] = ' 🖼️

'.htmlentities(empty($link[1])?rawurldecode($link[0]):$link[1]).'
';