diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Filters/MediaProcessingHtmlFilter.cs b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Filters/MediaProcessingHtmlFilter.cs index cdaecc6b4be..2ff487da2bf 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Filters/MediaProcessingHtmlFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Filters/MediaProcessingHtmlFilter.cs @@ -25,8 +25,7 @@ public class MediaProcessingHtmlFilter : IHtmlFilter { private MediaHtmlFilterSettingsPart _settingsPart; private static readonly Regex _imageTagRegex = new Regex(@"]*>", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly ConcurrentDictionary _attributeRegexes = new ConcurrentDictionary(); - private static readonly ConcurrentDictionary> _attributeValues = - new ConcurrentDictionary>(); + private static readonly ConcurrentDictionary _attributeValues = new ConcurrentDictionary(); private static readonly Dictionary _validExtensions = new Dictionary { { ".jpeg", "jpg" }, // For example: .jpeg supports compression (quality), format to 'jpg'. { ".jpg", "jpg" }, @@ -177,8 +176,7 @@ private string ProcessImageAltContent(string imgTag) { private string GetAttributeValue(string tag, string attributeName) => _attributeValues - .GetOrAdd(tag, _ => new ConcurrentDictionary()) - .GetOrAdd(attributeName, _ => { + .GetOrAdd($"{tag}_{attributeName}", _ => { var match = GetAttributeRegex(attributeName).Match(tag); return match.Success ? match.Groups[1].Value : null; });