aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index f6956d82..c6376a26 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -56,6 +56,7 @@
#include <QtCore/QPointer>
#include <QtCore/QDir>
#include <QtCore/QTemporaryFile>
+#include <QtCore/QRegularExpression>
#include <QtCore/QMimeDatabase>
#include <array>
@@ -1804,7 +1805,8 @@ void Room::downloadFile(const QString& eventId, const QUrl& localFilename)
{
// Build our own file path, starting with temp directory and eventId.
filePath = eventId;
- filePath = QDir::tempPath() % '/' % filePath.replace(':', '_') %
+ filePath = QDir::tempPath() % '/' %
+ filePath.replace(QRegularExpression("[/\\<>|\"*?:]"), "_") %
'#' % d->fileNameToDownload(event);
}
auto job = connection()->downloadFile(fileUrl, filePath);