Merge pull request #4256 from sbwalker/dev

add defensive logic to route parsing
This commit is contained in:
Shaun Walker 2024-05-13 08:45:15 -04:00 committed by GitHub
commit 2f66165f8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,13 +43,19 @@ namespace Oqtane.Models
int pos = PagePath.IndexOf("/" + Constants.UrlParametersDelimiter + "/");
if (pos != -1)
{
UrlParameters = PagePath.Substring(pos + 3);
if (pos + 3 < PagePath.Length)
{
UrlParameters = PagePath.Substring(pos + 3);
}
PagePath = PagePath.Substring(0, pos);
}
pos = PagePath.IndexOf("/" + Constants.ModuleDelimiter + "/");
if (pos != -1)
{
ModuleId = PagePath.Substring(pos + 3);
if (pos + 3 < PagePath.Length)
{
ModuleId = PagePath.Substring(pos + 3);
}
PagePath = PagePath.Substring(0, pos);
}
if (ModuleId.Length != 0)