1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-18 20:40:43 +01:00

Fix detection of parent-relative paths in playlist saving

File or directory names containing ``..`` caused saved playlists to
contain absolute paths instead of relative paths even when the relative
path was "safe".  This changes the detection to be more strict.

Potentially related to #4463.
This commit is contained in:
Alan Briolat 2014-08-12 11:40:20 +01:00
parent 20923c7303
commit a0c890592f

View File

@ -91,7 +91,7 @@ QString ParserBase::URLOrRelativeFilename(const QUrl& url,
if (QDir::isAbsolutePath(filename)) {
const QString relative = dir.relativeFilePath(filename);
if (!relative.contains("..")) return relative;
if (!relative.startsWith("../")) return relative;
}
return filename;
}