ticket 650: plainToHtml, use https if app.env !== 'local'

This commit is contained in:
Jérémy Munsch 2022-03-22 12:40:35 +01:00
parent 74aebc4010
commit 462082ed28
No known key found for this signature in database
GPG key ID: 55196BEE445F6049

View file

@ -26,7 +26,11 @@ class Utils
} else {
$url = $match;
if (\strpos($url, 'http') === false and \strpos($url, 'https') === false) {
$url = sprintf('http://%s', $url);
$url = sprintf(
'%s://%s',
config('app.env') !== 'local' ? 'https' : 'http',
$url
);
}
$fsligthbox = self::isImageFile($url) ? 'data-fslightbox="gallery"' : '';
return strlen($match) ? "<a $fsligthbox href=\"$url\" target=\"_blank\">$match</a>" : $match;