1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 16:12:57 +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
parent 5f00d3e2a4
commit 2e2dcd99a6
No known key found for this signature in database
GPG Key ID: EBD46BB3049B56D6

View File

@ -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);
}
}