fix #6154 - handle invalid urls

This commit is contained in:
sbwalker
2026-03-30 08:48:33 -04:00
parent 4c39aadff4
commit 99949bdeb9

View File

@@ -66,9 +66,12 @@ namespace Oqtane.Models
Action = ModuleId.Substring(pos + 1);
Action = (!string.IsNullOrEmpty(Action)) ? Action : Constants.DefaultAction;
ModuleId = ModuleId.Substring(0, pos);
ModuleId = (int.TryParse(ModuleId, out _)) ? ModuleId : "-1";
}
}
if (!int.TryParse(ModuleId, out _))
{
ModuleId = "-1";
}
if (PagePath.StartsWith("/"))
{
PagePath = (PagePath.Length == 1) ? "" : PagePath.Substring(1);