Skip to content

Commit

Permalink
Fix string comparison changes in YesSql queries (OrchardCMS#15212)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros authored and urbanit committed Mar 18, 2024
1 parent 9397fee commit 5c6418a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public async Task<string> GetContentItemIdAsync(string handle)
internal class AliasPartContentHandleHelper
{
internal static Task<ContentItem> QueryAliasIndex(ISession session, string alias) =>
session.Query<ContentItem, AliasPartIndex>(x => x.Alias.Equals(alias, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefaultAsync();
session.Query<ContentItem, AliasPartIndex>(x => x.Alias == alias.ToLowerInvariant()).FirstOrDefaultAsync();
}
}
2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override void ConfigureServices(IServiceCollection services)
var session = context.Services.GetRequiredService<ISession>();
var contentItem = await session.Query<ContentItem, AliasPartIndex>(x =>
x.Published && x.Alias.Equals(alias, System.StringComparison.InvariantCultureIgnoreCase))
x.Published && x.Alias == alias.ToLowerInvariant())
.FirstOrDefaultAsync();
if (contentItem == null)
Expand Down

0 comments on commit 5c6418a

Please sign in to comment.