From 73d819615a175babef260cc9c1c22bb98ebde8e3 Mon Sep 17 00:00:00 2001 From: Karsten Thuen Date: Tue, 2 Apr 2024 14:53:21 +0200 Subject: [PATCH] #18409 - Use EscapeUriString --- .../Templates/Designs/Swift/Components/VideoPlayer.cshtml | 2 +- .../Swift/Paragraph/Swift_ProductDetailsGallery.cshtml | 6 +++--- .../Swift/Paragraph/Swift_ProductDetailsImage.cshtml | 4 ++-- .../Swift/Paragraph/Swift_ProductDetailsMediaTable.cshtml | 6 +++--- .../Designs/Swift/Paragraph/Swift_VideoPoster.cshtml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Swift/Files/Templates/Designs/Swift/Components/VideoPlayer.cshtml b/Swift/Files/Templates/Designs/Swift/Components/VideoPlayer.cshtml index 0a40b4641..065f898bf 100644 --- a/Swift/Files/Templates/Designs/Swift/Components/VideoPlayer.cshtml +++ b/Swift/Files/Templates/Designs/Swift/Components/VideoPlayer.cshtml @@ -116,7 +116,7 @@ { string autoPlayAttributes = (autoPlay && !openInModal) ? "loop autoplay muted playsinline" : ""; string videoType = Path.GetExtension(link).ToLower(); - string videoPathEncoded = System.Uri.EscapeDataString(link); + string videoPathEncoded = System.Uri.EscapeUriString(link); diff --git a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsGallery.cshtml b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsGallery.cshtml index 1a8a550ba..d6ff67f90 100644 --- a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsGallery.cshtml +++ b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsGallery.cshtml @@ -259,7 +259,7 @@ string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/"; string type = GetVideoType(asset.Value); - string videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : string.Empty; + string videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : string.Empty; videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value, "maxresdefault") : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : string.Empty; @@ -424,7 +424,7 @@ string type = GetVideoType(asset.Value); - string videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : string.Empty; + string videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : string.Empty; videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value, "maxresdefault") : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : ""; @@ -524,7 +524,7 @@ string type = GetVideoType(asset.Value); string videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value, "maxresdefault") : string.Empty; - videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : videoScreendumpPath; + videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : string.Empty; string productName = product.Name; diff --git a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsImage.cshtml b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsImage.cshtml index e429a4911..6a22e0726 100644 --- a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsImage.cshtml +++ b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsImage.cshtml @@ -273,7 +273,7 @@ string type = GetVideoType(asset.Value); string videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value, "maxresdefault") : string.Empty; - videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : videoScreendumpPath; + videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : ""; @@ -410,7 +410,7 @@ string videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value, "mqdefault") : ""; videoScreendumpPath = type == "vimeo" ? string.Empty : videoScreendumpPath; - videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : videoScreendumpPath; + videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : string.Empty;
@ReadFile(iconPath + "play-circle.svg")
diff --git a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsMediaTable.cshtml b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsMediaTable.cshtml index fc664ff3d..ccb70dcfd 100644 --- a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsMediaTable.cshtml +++ b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ProductDetailsMediaTable.cshtml @@ -249,7 +249,7 @@ string type = GetVideoType(asset.Value); string videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value) : string.Empty; - videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : videoScreendumpPath; + videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : string.Empty;
@@ -356,7 +356,7 @@ { string type = GetVideoType(asset.Value); string videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value) : string.Empty; - videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : videoScreendumpPath; + videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : string.Empty; @@ -468,7 +468,7 @@ string type = GetVideoType(asset.Value); string videoScreendumpPath = type == "youtube" ? GetYoutubeScreenDump(asset.Value) : string.Empty; - videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeDataString(asset.Value) : videoScreendumpPath; + videoScreendumpPath = type == "selfhosted" ? System.Uri.EscapeUriString(asset.Value) : videoScreendumpPath; string videoJsClass = type == "vimeo" ? "js-vimeo-video-thumbnail" : string.Empty; string productName = product.Name; diff --git a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_VideoPoster.cshtml b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_VideoPoster.cshtml index df023ab99..c6f81c520 100644 --- a/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_VideoPoster.cshtml +++ b/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_VideoPoster.cshtml @@ -93,7 +93,7 @@ imageFilter = imageFilter == "no-filter" ? "" : imageFilter; imageFilter = imageFilter == "filter" ? " image-filter" : imageFilter; string videoType = Path.GetExtension(video).ToLower(); - string videoPath = System.Uri.EscapeDataString(Model.Item.GetString("Video")); + string videoPath = System.Uri.EscapeUriString(Model.Item.GetString("Video"));