#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:
Dave Reed
2010-12-10 14:20:08 -08:00
parent 919a57c1bf
commit 629a48958f
11 changed files with 59 additions and 98 deletions

View File

@@ -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));