From 462082ed284e16240c908f682083484ba3ab071f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 22 Mar 2022 12:40:35 +0100 Subject: [PATCH] ticket 650: plainToHtml, use https if app.env !== 'local' --- app/Lib/Utils.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Lib/Utils.php b/app/Lib/Utils.php index a977e4f..caabc09 100644 --- a/app/Lib/Utils.php +++ b/app/Lib/Utils.php @@ -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) ? "$match" : $match;