diff --git a/Composite/Core/WebClient/MediaUrlHelper.cs b/Composite/Core/WebClient/MediaUrlHelper.cs index c2cce51668..f07b78729f 100644 --- a/Composite/Core/WebClient/MediaUrlHelper.cs +++ b/Composite/Core/WebClient/MediaUrlHelper.cs @@ -27,6 +27,9 @@ public static class MediaUrlHelper private static readonly string DecodedFullInternalMediaUrlPrefix = InternalMediaUrlPrefix + "("; private static readonly string RawMediaUrlPrefix = "~/media"; + private static readonly string ForbiddenUrlCharacters = @"<>*%&\?"; + + /// public static string GetUrl(IMediaFile file) { @@ -276,6 +279,12 @@ public static string ChangeInternalMediaUrlsToPublic(string content) string pathToFile = UrlUtils.Combine(file.FolderPath, file.FileName); + // Hotfix for characters not accepted by ASP.NET by default + foreach (var ch in ForbiddenUrlCharacters) + { + pathToFile = pathToFile.Replace(ch, 'x'); + } + // IIS6 doesn't have wildcard mapping by default, so removing image extension if running in "classic" app pool if(!HttpRuntime.UsingIntegratedPipeline) {