From a0c890592fa843e36a4fa71eb258bf3ec7656e57 Mon Sep 17 00:00:00 2001 From: Alan Briolat Date: Tue, 12 Aug 2014 11:40:20 +0100 Subject: [PATCH] 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. --- src/playlistparsers/parserbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/playlistparsers/parserbase.cpp b/src/playlistparsers/parserbase.cpp index 578dbbfd5..343ab0c47 100644 --- a/src/playlistparsers/parserbase.cpp +++ b/src/playlistparsers/parserbase.cpp @@ -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; }