From baa1c9bf4f3278d2def6b6ec0e84a15bf891aa1b Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Mon, 2 Feb 2009 12:02:09 +0100 Subject: [PATCH] escape unallowed chars before opening/saving file with lyrics --- src/lyrics.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lyrics.cpp b/src/lyrics.cpp index cd159dda..67be5644 100644 --- a/src/lyrics.cpp +++ b/src/lyrics.cpp @@ -309,7 +309,9 @@ void *GetLyrics(void *song) locale_to_utf(artist); locale_to_utf(title); - const string fullpath = lyrics_folder + "/" + artist + " - " + title + ".txt"; + string filename = artist + " - " + title + ".txt"; + EscapeUnallowedChars(filename); + const string fullpath = lyrics_folder + "/" + filename; mkdir(lyrics_folder.c_str(), 0755);