mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Merge pull request #5926 from JRKelso/patch-3
[Fixes #5885] Validating permalink length
This commit is contained in:
@@ -144,6 +144,10 @@ namespace Orchard.Autoroute.Drivers {
|
||||
if (!_autorouteService.IsPathValid(part.DisplayAlias)) {
|
||||
updater.AddModelError("CurrentUrl", T("Please do not use any of the following characters in your permalink: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \", \"<\", \">\", \"\\\", \"|\", \"%\", \".\". No spaces are allowed (please use dashes or underscores instead)."));
|
||||
}
|
||||
|
||||
if (part.DisplayAlias != null && part.DisplayAlias.Length > 1850){
|
||||
updater.AddModelError("CurrentUrl", T("Your permalink is too long. The permalink can only be up to 1,850 characters."));
|
||||
}
|
||||
|
||||
// Mark the content item to be the homepage. Once this content isp ublished, the home alias will be updated to point to this content item.
|
||||
part.PromoteToHomePage = viewModel.PromoteToHomePage;
|
||||
|
Reference in New Issue
Block a user