--HG--
branch : 1.x
This commit is contained in:
Dave Reed
2011-04-05 15:02:31 -07:00
4 changed files with 7 additions and 6 deletions

View File

@@ -89,7 +89,7 @@ namespace Orchard.Core.Routable.Drivers {
if ( slug.StartsWith(".") || slug.EndsWith(".") )
updater.AddModelError("Routable.Slug", T("The \".\" can't be used at either end of the permalink."));
else
updater.AddModelError("Routable.Slug", T("Please do not use any of the following characters in your permalink: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \", \"<\", \">\". No spaces are allowed (please use dashes or underscores instead)."));
updater.AddModelError("Routable.Slug", T("Please do not use any of the following characters in your permalink: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \", \"<\", \">\", \"\\\". No spaces are allowed (please use dashes or underscores instead)."));
}
return Editor(part, shapeHelper);

View File

@@ -57,7 +57,7 @@ namespace Orchard.Core.Routable.Services {
}
if (!slugContext.Adjusted) {
var disallowed = new Regex(@"[/:?#\[\]@!$&'()*+,;=\s\""\<\>]+");
var disallowed = new Regex(@"[/:?#\[\]@!$&'()*+,;=\s\""\<\>\\]+");
slugContext.Slug = disallowed.Replace(slugContext.Slug, "-").Trim('-');
@@ -108,7 +108,7 @@ namespace Orchard.Core.Routable.Services {
}
public bool IsSlugValid(string slug) {
return String.IsNullOrWhiteSpace(slug) || Regex.IsMatch(slug, @"^[^:?#\[\]@!$&'()*+,;=\s\""\<\>]+$") && !(slug.StartsWith(".") || slug.EndsWith("."));
return String.IsNullOrWhiteSpace(slug) || Regex.IsMatch(slug, @"^[^:?#\[\]@!$&'()*+,;=\s\""\<\>\\]+$") && !(slug.StartsWith(".") || slug.EndsWith("."));
}
public bool ProcessSlug(IRoutableAspect part) {