1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 08:02:38 +08:00

fix(AudioCheckUtils): use Path.GetExtension()

To avoid filename escaping
This commit is contained in:
tsrk
2023-09-01 20:56:42 +02:00
Unverified
parent 5f00d3e2a4
commit 2e2dcd99a6
@@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.IO;
using System.Linq;
namespace osu.Game.Rulesets.Edit.Checks.Components
@@ -9,6 +10,6 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
{
public static readonly string[] AUDIO_EXTENSIONS = { "mp3", "ogg", "wav" };
public static bool HasAudioExtension(string filename) => AUDIO_EXTENSIONS.Any(filename.ToLowerInvariant().EndsWith);
public static bool HasAudioExtension(string filename) => AUDIO_EXTENSIONS.Any(Path.GetExtension(filename).ToLowerInvariant().EndsWith);
}
}