mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 11:17:28 +08:00
#17021 Redirects in actions using returnUrl need to only redirect to the returnUrl if Url.IsLocalUrl
We did this in a lot of places. Adds a controller extension method that makes this easier. --HG-- branch : dev
This commit is contained in:
@@ -8,6 +8,7 @@ using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Environment.Features;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.Reports.Services;
|
||||
using Orchard.Security;
|
||||
using Orchard.Themes.Preview;
|
||||
@@ -85,7 +86,7 @@ namespace Orchard.Themes.Controllers {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ApplyTheme, T("Couldn't preview the current theme")))
|
||||
return new HttpUnauthorizedResult();
|
||||
_previewTheme.SetPreviewTheme(themeName);
|
||||
return Redirect(returnUrl ?? "~/");
|
||||
return this.RedirectLocal(returnUrl, "~/");
|
||||
}
|
||||
catch (Exception exception) {
|
||||
Services.Notifier.Error(T("Previewing theme failed: " + exception.Message));
|
||||
|
Reference in New Issue
Block a user