#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

@@ -4,6 +4,7 @@ using System.Linq;
using System.Web.Mvc;
using Orchard.Core.Contents.Controllers;
using Orchard.Localization;
using Orchard.Mvc.Extensions;
using Orchard.Roles.Models;
using Orchard.Roles.Services;
using Orchard.Roles.ViewModels;
@@ -160,10 +161,7 @@ namespace Orchard.Roles.Controllers {
Services.Notifier.Information(T("Role was successfully deleted."));
if (!string.IsNullOrWhiteSpace(returnUrl))
return Redirect(returnUrl);
return RedirectToAction("Index");
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
} catch (Exception exception) {
Services.Notifier.Error(T("Editing Role failed: {0}", exception.Message));
return RedirectToAction("Edit", id);