Commit bf5f5aaa authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Kurt Hindenburg
Browse files

make the allowed url scheme checking safer

parent 62988602
......@@ -22,6 +22,8 @@
#include "EscapeSequenceUrlExtractor.h"
#include <QUrl>
namespace Konsole {
EscapeSequenceUrlExtractor::EscapeSequenceUrlExtractor()
{
......@@ -60,13 +62,11 @@ void EscapeSequenceUrlExtractor::appendUrlText(QChar c)
void EscapeSequenceUrlExtractor::setUrl(const QString& url)
{
_currentUrl.url = url;
for (const auto &schema : _allowedUriSchemas) {
if (url.startsWith(schema)) {
return;
}
if (_allowedUriSchemas.contains(QUrl(url).scheme())) {
_currentUrl.url = url;
} else {
abortUrlInput();
}
abortUrlInput();
}
void EscapeSequenceUrlExtractor::abortUrlInput()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment