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:
parent
20923c7303
commit
a0c890592f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user