#21054: Fixing issue with null UrlReferer.

I still think an issue is outstanding with AdminFilter.

Work Item: 21054
This commit is contained in:
Nicholas Mayne
2015-03-13 15:23:19 +00:00
parent b6347a5de9
commit 8470165a55

View File

@@ -28,7 +28,10 @@ namespace Orchard.Localization.Selectors {
// Attempt to determine culture by previous route if by POST
string path;
if (context.Request.HttpMethod.Equals(HttpVerbs.Post.ToString(), StringComparison.OrdinalIgnoreCase)) {
path = context.Request.UrlReferrer.AbsolutePath;
if (context.Request.UrlReferrer != null)
path = context.Request.UrlReferrer.AbsolutePath;
else
path = context.Request.Path;
}
else {
path = context.Request.Path;