Fixes U4-741 - umbracoReservedPaths was not properly filtering after removing trailing slashes

This commit is contained in:
sebastiaan
2012-09-06 12:25:04 -02:00
parent 874faf6f83
commit 70a814a20c

View File

@@ -806,14 +806,17 @@ namespace Umbraco.Core.Configuration
public int Compare(string part, string whole)
{
// let the default string comparer deal with null or when part is not smaller then whole
if (part == null || whole == null)
if (part == null || whole == null || part.Length >= whole.Length)
return _stringComparer.Compare(part, whole);
//trim the end '/' of each
part = part.TrimEnd('/');
whole = whole.TrimEnd('/');
if (part.Length >= whole.Length)
return _stringComparer.Compare(part, whole);
// Reverted changeset 4d5a20d6124d because it will match with
// anything starting with install and umbraco see issue U4-741
////trim the end '/' of each
//part = part.TrimEnd('/');
//whole = whole.TrimEnd('/');
//if (part.Length >= whole.Length)
// return _stringComparer.Compare(part, whole);
// loop through all characters that part and whole have in common
int pos = 0;