Merge pull request #6155 from sbwalker/dev

fix #6154 - handle invalid urls
This commit is contained in:
Shaun Walker
2026-03-30 08:48:58 -04:00
committed by GitHub

View File

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