Merge pull request #639 from PoisnFang/routing

Hot fix for homepage routing
This commit is contained in:
Shaun Walker 2020-06-30 16:54:54 -04:00 committed by GitHub
commit 468ca8c6a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,18 +222,18 @@
moduleid = result; moduleid = result;
if (actionPos > segments.Length - 1) if (actionPos > segments.Length - 1)
{ {
path = path.Replace("/" + segments[modIdPos - 1] + "/" + segments[modIdPos], ""); path = path.Replace(segments[modIdPos - 1] + "/" + segments[modIdPos] + "/", "");
} }
else else
{ {
path = path.Replace("/" + segments[modIdPos - 1] + "/" + segments[modIdPos] + "/" + segments[actionPos], ""); path = path.Replace(segments[modIdPos - 1] + "/" + segments[modIdPos] + "/" + segments[actionPos] + "/", "");
} }
} }
if (urlParametersPos > 0) if (urlParametersPos > 0)
{ {
path = path.Replace("/" + segments[urlParametersPos - 1] + urlparameters, ""); path = path.Replace(segments[urlParametersPos - 1] + urlparameters + "/", "");
} }
// remove trailing slash so it can be used as a key for Pages // remove trailing slash so it can be used as a key for Pages