From 1b762a6e648e00d09b5f59779586a29251a6cc5c Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Fri, 29 Dec 2023 09:02:48 +0100 Subject: [PATCH] Fix references with URL that does not contains protocol --- app/Templates/default/reference.html.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Templates/default/reference.html.twig b/app/Templates/default/reference.html.twig index e2f346c..6d4111b 100644 --- a/app/Templates/default/reference.html.twig +++ b/app/Templates/default/reference.html.twig @@ -79,7 +79,12 @@ {% if reference.url %} - {{ reference.name }} + {% if reference.url matches '/^https?:\\/\\//' %} + {% set ref_url = reference.url %} + {% else %} + {% set ref_url = 'https://' ~ reference.url %} + {% endif %} + {{ reference.name }} {% else %} {{ reference.name }} {% endif %}