#19149: Fixing RedirectLocal extension method

It was still using the MVC implementation of IsLocalUrl instead of Orchard's
one.

Work Item: 19149

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-10-18 10:17:19 -07:00
parent 7c78182cf3
commit 7f355de662

View File

@@ -6,7 +6,7 @@ using Orchard.Utility.Extensions;
namespace Orchard.Mvc.Extensions {
public static class ControllerExtensions {
public static ActionResult RedirectLocal(this Controller controller, string redirectUrl, Func<ActionResult> invalidUrlBehavior) {
if (!string.IsNullOrWhiteSpace(redirectUrl) && controller.Url.IsLocalUrl(redirectUrl)) {
if (!string.IsNullOrWhiteSpace(redirectUrl) && controller.Request.IsLocalUrl(redirectUrl)) {
return new RedirectResult(redirectUrl);
}
return invalidUrlBehavior != null ? invalidUrlBehavior() : null;