Merge pull request #4989 from sbwalker/dev

fix #4984 - ensure personalized page path does not contain illegal characters
This commit is contained in:
Shaun Walker 2025-01-14 15:43:00 -05:00 committed by GitHub
commit cd45bf4b70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -189,14 +189,15 @@ namespace Oqtane.Controllers
User user = _userPermissions.GetUser(User);
if (parent != null && parent.SiteId == _alias.SiteId && parent.IsPersonalizable && user.UserId == int.Parse(userid))
{
page = _pages.GetPage(parent.Path + "/" + user.Username, parent.SiteId);
var path = parent.Path + "/" + Utilities.GetFriendlyUrl(user.Username);
page = _pages.GetPage(path, parent.SiteId);
if (page == null)
{
page = new Page();
page.SiteId = parent.SiteId;
page.ParentId = parent.PageId;
page.Name = (!string.IsNullOrEmpty(user.DisplayName)) ? user.DisplayName : user.Username;
page.Path = parent.Path + "/" + user.Username;
page.Path = path;
page.Title = page.Name + " - " + parent.Name;
page.Order = 0;
page.IsNavigation = false;