From a208e8e1a319223b94d3be857bb6aaab3f8db5b0 Mon Sep 17 00:00:00 2001 From: minuq Date: Wed, 6 Apr 2022 16:03:13 +0200 Subject: [PATCH] Update parser.cpp Fixes #24 by adding "#" as problematic character --- src/parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index d18f738..ec6289b 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -11,7 +11,7 @@ QString Parser::escapeString(QString untrimmedStr) { // Remove problematic characters for file systems that are allowed in RWTHmoodle - QString escapePattern = "(:|<|>|/|\\\\|\\||\\*|\\^|\\?|\\\")"; + QString escapePattern = "(:|<|>|/|\\\\|\\||\\*|\\^|\\?|\\\"|\\#)"; QRegExp escapeRegExp(escapePattern, Qt::CaseSensitive); QString trimmedStr = untrimmedStr.replace(escapeRegExp, "").trimmed(); // Limit length as sometimes super long titles are used @@ -112,7 +112,7 @@ void Parser::parseMoodleFiles(QNetworkReply *reply, Structureelement* course) topicname = escapeString(file["topicname"].toString()); modulename = escapeString(file["modulename"].toString()); - filename = file["filename"].toString(); + filename = escapeString(file["filename"].toString()); sourceDirectory = file["sourceDirectory"].toString(); filesize = fileInformation["filesize"].toInt(); timestamp = file["lastModified"].toInt();