mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#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:
@@ -6,7 +6,7 @@ using Orchard.Utility.Extensions;
|
|||||||
namespace Orchard.Mvc.Extensions {
|
namespace Orchard.Mvc.Extensions {
|
||||||
public static class ControllerExtensions {
|
public static class ControllerExtensions {
|
||||||
public static ActionResult RedirectLocal(this Controller controller, string redirectUrl, Func<ActionResult> invalidUrlBehavior) {
|
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 new RedirectResult(redirectUrl);
|
||||||
}
|
}
|
||||||
return invalidUrlBehavior != null ? invalidUrlBehavior() : null;
|
return invalidUrlBehavior != null ? invalidUrlBehavior() : null;
|
||||||
|
Reference in New Issue
Block a user