Skip to content

Commit

Permalink
Merged PR 12682: #18409 - Use EscapeUriString
Browse files Browse the repository at this point in the history
#18409 - Use EscapeUriString

Related work items: #18409
  • Loading branch information
kthdynamic committed Apr 3, 2024
2 parents 6e6e3f3 + 73d8196 commit da8ac7f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
<video preload="auto" @autoPlayAttributes class="h-100 w-100" style="object-fit: cover;" controls>
<source src="@(videoPathEncoded)#t=0.001" type="video/@videoType.Replace(".", "")">
</video>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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" : "";

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" : "";


Expand Down Expand Up @@ -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;

<div class="icon-5 position-absolute" style="z-index: 1">@ReadFile(iconPath + "play-circle.svg")</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

<div class="d-block @(ratioSettings.CssClass)@(ratioSettings.Fill)" style="@(ratioSettings.CssVariable)">
Expand Down Expand Up @@ -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;


Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

<div class="position-absolute top-0 bottom-0 end-0 start-0@(imageFilter)">
<video preload="auto" loop autoplay muted playsinline class="h-100 w-100" style="object-fit: cover;">
Expand Down

0 comments on commit da8ac7f

Please sign in to comment.