diff --git a/global.cpp b/global.cpp index ac5bcd2..a664050 100644 --- a/global.cpp +++ b/global.cpp @@ -36,11 +36,11 @@ QString getValue(const QString &string, const QString &key, Type type) result.remove(QRegularExpression("^.*"+key+"\\s*=", QRegularExpression::DotMatchesEverythingOption)); } - QString separator {"\n"}; + QString separator {'\n'}; if (type == eForTriggers) { separator = ":::"; } else if (type == eForWeb) { - separator = " "; + separator = '&'; } else if (type == eHttpHeader) { separator = "\r\n"; } @@ -49,6 +49,13 @@ QString getValue(const QString &string, const QString &key, Type type) if (valueEnd != -1) { result.remove(valueEnd, result.size()-valueEnd); } + else if (valueEnd == -1 and type == eForWeb) { + separator = ' '; + valueEnd = result.indexOf(separator); + if (valueEnd != -1) { + result.remove(valueEnd, result.size()-valueEnd); + } + } if (type == eForWeb) { result = QByteArray::fromPercentEncoding(result.toUtf8()); diff --git a/html/main.html b/html/main.html index 5581fc8..94cb858 100644 --- a/html/main.html +++ b/html/main.html @@ -20,9 +20,17 @@