mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
Fixing IsLocalUrl
--HG-- branch : 1.x
This commit is contained in:
@@ -15,7 +15,12 @@ namespace Orchard.Mvc.Extensions {
|
||||
}
|
||||
|
||||
public static ActionResult RedirectLocal(this Controller controller, string redirectUrl, string defaultUrl) {
|
||||
if (!string.IsNullOrWhiteSpace(redirectUrl) && controller.Url.IsLocalUrl(redirectUrl)) {
|
||||
if (!string.IsNullOrWhiteSpace(redirectUrl)
|
||||
&& controller.Url.IsLocalUrl(redirectUrl)
|
||||
&& redirectUrl.StartsWith("/")
|
||||
&& !redirectUrl.StartsWith("//")
|
||||
&& !redirectUrl.StartsWith("/\\")) {
|
||||
|
||||
return new RedirectResult(redirectUrl);
|
||||
}
|
||||
return new RedirectResult(defaultUrl ?? "~/");
|
||||
|
||||
Reference in New Issue
Block a user