#19071: Replacing UrlHelper.IsLocalUrl by custom implementation

Work Item: 19071

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-10-05 15:05:12 -07:00
parent b33d6081d3
commit 889709239f
5 changed files with 120 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ using Orchard.Mvc.Html;
using Orchard.UI.Navigation;
using Orchard.UI.Notify;
using Orchard.Settings;
using Orchard.Utility.Extensions;
namespace Orchard.Core.Contents.Controllers {
[ValidateInput(false)]
@@ -299,7 +300,7 @@ namespace Orchard.Core.Contents.Controllers {
string previousRoute = null;
if(contentItem.Has<IAliasAspect>()
&&!string.IsNullOrWhiteSpace(returnUrl)
&& Url.IsLocalUrl(returnUrl)
&& Request.IsLocalUrl(returnUrl)
// only if the original returnUrl is the content itself
&& String.Equals(returnUrl, Url.ItemDisplayUrl(contentItem), StringComparison.OrdinalIgnoreCase)
) {