From ef8cba804f270106ae73d4bea86da9d033a432a3 Mon Sep 17 00:00:00 2001 From: peolic <66393006+peolic@users.noreply.github.com> Date: Wed, 10 Jun 2020 03:13:57 +0300 Subject: [PATCH] Fix `sanitizeURL` (#599) --- ui/v2.5/src/utils/text.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/v2.5/src/utils/text.ts b/ui/v2.5/src/utils/text.ts index 496d1f1e6..3b5ec83a4 100644 --- a/ui/v2.5/src/utils/text.ts +++ b/ui/v2.5/src/utils/text.ts @@ -119,11 +119,11 @@ const sanitiseURL = (url?: string, siteURL?: URL) => { if (siteURL) { // if url starts with the site host, then prepend the protocol if (url.startsWith(siteURL.host)) { - return siteURL.protocol + url; + return `${siteURL.protocol}//${url}`; } // otherwise, construct the url from the protocol, host and passed url - return `${siteURL.protocol}${siteURL.host}/${url}`; + return `${siteURL.protocol}//${siteURL.host}/${url}`; } // just prepend the protocol - assume https