mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixing IsLocalUrl
--HG-- extra : rebase_source : 645fac775f5fe3fa8c4e9db1df1824cc524cf39b
This commit is contained in:
@@ -15,7 +15,12 @@ namespace Orchard.Mvc.Extensions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ActionResult RedirectLocal(this Controller controller, string redirectUrl, string defaultUrl) {
|
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(redirectUrl);
|
||||||
}
|
}
|
||||||
return new RedirectResult(defaultUrl ?? "~/");
|
return new RedirectResult(defaultUrl ?? "~/");
|
||||||
|
|||||||
Reference in New Issue
Block a user