OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Path generation is case sensitive and it potentially generates path that are actually the same path #8742

Closed AndreaPiovanelli closed 7 months ago

AndreaPiovanelli commented 9 months ago

https://github.com/OrchardCMS/Orchard/blob/9644ceda1f9b077d44aaa4ffaab103c19a59ddba/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AutorouteService.cs#L243C25-L243C25

AutorouteService.GetSimilarPaths loads up all the DisplayAlias strings that start with provided path. After that, a unique slug is generated (https://github.com/OrchardCMS/Orchard/blob/9644ceda1f9b077d44aaa4ffaab103c19a59ddba/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AutorouteService.cs#L188C25-L188C25) but the IEnumerable.Contains(string) function used to check if the path doesn't exist yet is case sensistive. This causes the creation of conflicting aliases (i.e. a "/TEST-PAGE" alias can be created even if a "/test-page" alias already exists in the tenant).