Skip to content

Commit

Permalink
Moved decoding to FindFullPath as encoded values should never be in path
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Cantelon committed Jul 23, 2015
1 parent 426583b commit 7313663
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions WebGitNet.SharedLib/FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public DirectoryInfo DirectoryInfo

public ResourceInfo GetResourceInfo(string resourcePath)
{
string decodedPath = HttpUtility.UrlDecode(resourcePath);
var fullPath = this.FindFullPath(decodedPath);
var fullPath = this.FindFullPath(resourcePath);
var info = new ResourceInfo { FullPath = fullPath };

if (!fullPath.StartsWith(this.rootPath))
Expand Down Expand Up @@ -69,7 +68,8 @@ public ResourceInfo GetResourceInfo(string resourcePath)

private string FindFullPath(string url)
{
var path = Path.Combine(this.rootPath, url);
string decodedUrl = HttpUtility.UrlDecode(url);
var path = Path.Combine(this.rootPath, decodedUrl);
return Path.GetFullPath(path);
}
}
Expand Down

0 comments on commit 7313663

Please sign in to comment.