mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fix for Application Path on localization to deal with virtual paths
This commit is contained in:
@@ -34,7 +34,10 @@ namespace Orchard.Localization.Selectors {
|
|||||||
path = context.Request.Path;
|
path = context.Request.Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
var content = GetByPath(path.TrimStart('/'));
|
var appPath = context.Request.ApplicationPath ?? "/";
|
||||||
|
var requestUrl = (path.StartsWith(appPath) ? path.Substring(appPath.Length) : path).TrimStart('/');
|
||||||
|
|
||||||
|
var content = GetByPath(requestUrl);
|
||||||
if (content != null) {
|
if (content != null) {
|
||||||
return new CultureSelectorResult { Priority = -2, CultureName = _localizationService.Value.GetContentCulture(content) };
|
return new CultureSelectorResult { Priority = -2, CultureName = _localizationService.Value.GetContentCulture(content) };
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user