Merge pull request #10781 from umbraco/v9/feature/merge_v8_dev_03082021

V9: Merge v8/dev 03082021
This commit is contained in:
Bjarke Berg
2021-08-04 10:40:34 +02:00
committed by GitHub
43 changed files with 638 additions and 450 deletions

View File

@@ -6,7 +6,6 @@ using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PropertyEditors.ValueConverters;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Web.Common.DependencyInjection;
using Umbraco.Core.Models;
namespace Umbraco.Extensions
{

View File

@@ -7,7 +7,6 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PropertyEditors.ValueConverters;
using Umbraco.Cms.Core.Routing;
using Umbraco.Core.Models;
namespace Umbraco.Extensions
{

View File

@@ -217,9 +217,11 @@ namespace Umbraco.Extensions
}
var url = mediaItem.GetCropUrl(cropAlias: cropAlias, useCropDimensions: true);
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
return CreateHtmlString(url, htmlEncode);
}
private static IHtmlContent CreateHtmlString(string url, bool htmlEncode) => htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
public static IHtmlContent GetCropUrl(this IUrlHelper urlHelper, IPublishedContent mediaItem, string propertyAlias, string cropAlias, bool htmlEncode = true)
{
if (mediaItem == null)
@@ -228,7 +230,7 @@ namespace Umbraco.Extensions
}
var url = mediaItem.GetCropUrl(propertyAlias: propertyAlias, cropAlias: cropAlias, useCropDimensions: true);
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
return CreateHtmlString(url, htmlEncode);
}
public static IHtmlContent GetCropUrl(this IUrlHelper urlHelper,
@@ -256,7 +258,7 @@ namespace Umbraco.Extensions
var url = mediaItem.GetCropUrl(width, height, propertyAlias, cropAlias, quality, imageCropMode,
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBuster, furtherOptions, ratioMode,
upScale);
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
return CreateHtmlString(url, htmlEncode);
}
public static IHtmlContent GetCropUrl(this IUrlHelper urlHelper,
@@ -281,7 +283,7 @@ namespace Umbraco.Extensions
var url = imageUrl.GetCropUrl(imageCropperValue, width, height, cropAlias, quality, imageCropMode,
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode,
upScale);
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
return CreateHtmlString(url, htmlEncode);
}
/// <summary>