1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Fix SkinManager not handling extensions casing comparsion properly

This commit is contained in:
Salman Ahmed 2021-03-24 21:31:53 +03:00
parent 6a37fb41cc
commit fc5719e445

View File

@ -104,7 +104,7 @@ namespace osu.Game.Skinning
protected override string ComputeHash(SkinInfo item, ArchiveReader reader = null) protected override string ComputeHash(SkinInfo item, ArchiveReader reader = null)
{ {
// we need to populate early to create a hash based off skin.ini contents // we need to populate early to create a hash based off skin.ini contents
if (item.Name?.Contains(".osk") == true) if (item.Name?.EndsWith(".osk", StringComparison.OrdinalIgnoreCase) == true)
populateMetadata(item); populateMetadata(item);
if (item.Creator != null && item.Creator != unknown_creator_string) if (item.Creator != null && item.Creator != unknown_creator_string)
@ -122,7 +122,7 @@ namespace osu.Game.Skinning
{ {
await base.Populate(model, archive, cancellationToken).ConfigureAwait(false); await base.Populate(model, archive, cancellationToken).ConfigureAwait(false);
if (model.Name?.Contains(".osk") == true) if (model.Name?.EndsWith(".osk", StringComparison.OrdinalIgnoreCase) == true)
populateMetadata(model); populateMetadata(model);
} }
@ -137,7 +137,7 @@ namespace osu.Game.Skinning
} }
else else
{ {
item.Name = item.Name.Replace(".osk", ""); item.Name = item.Name.Replace(".osk", "", StringComparison.OrdinalIgnoreCase);
item.Creator ??= unknown_creator_string; item.Creator ??= unknown_creator_string;
} }
} }