From f01f534293d0cbcc9864b23c1b6879fe0f4c1863 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 19 May 2022 10:43:27 +0800 Subject: [PATCH] Check `ReturnUrl` not null. --- .../Pages/Account/Manage.cshtml.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs index 746992822c..d669ec41a1 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs @@ -34,11 +34,14 @@ public class ManageModel : AccountPageModel await contributor.ConfigureAsync(ProfileManagementPageCreationContext); } - if (!Url.IsLocalUrl(ReturnUrl) && - !ReturnUrl.StartsWith(UriHelper.BuildAbsolute(Request.Scheme, Request.Host, Request.PathBase).RemovePostFix("/")) && - !AppUrlProvider.IsRedirectAllowedUrl(ReturnUrl)) + if (ReturnUrl != null) { - ReturnUrl = null; + if (!Url.IsLocalUrl(ReturnUrl) && + !ReturnUrl.StartsWith(UriHelper.BuildAbsolute(Request.Scheme, Request.Host, Request.PathBase).RemovePostFix("/")) && + !AppUrlProvider.IsRedirectAllowedUrl(ReturnUrl)) + { + ReturnUrl = null; + } } return Page();