Support Azure media urls containing special chars

This commit is contained in:
Sebastien Ros
2014-02-24 09:38:08 -08:00
parent 82001a2bcc
commit 18118b44ee
2 changed files with 3 additions and 1 deletions

View File

@@ -84,6 +84,7 @@
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Web" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.Extensions" />

View File

@@ -1,4 +1,5 @@
using System.IO;
using System.Web;
using Orchard.Azure.Services.Environment.Configuration;
using Orchard.Environment.Configuration;
using Orchard.Environment.Extensions;
@@ -51,7 +52,7 @@ namespace Orchard.Azure.Services.FileSystems.Media {
/// <returns>The corresponding local path.</returns>
public string GetStoragePath(string url) {
if (url.StartsWith(_absoluteRoot)) {
return url.Substring(Combine(_absoluteRoot, "/").Length);
return HttpUtility.UrlDecode(url.Substring(Combine(_absoluteRoot, "/").Length));
}
return null;