aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-05-13 20:42:50 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-03-25 22:35:23 +0100
commitfb63012ec32c98c663802951153207442d1d63df (patch)
tree93451886ebec292cc1df720586b38397409d6984
parent9e58bbe349205ded067fdc92c221fa128a05820f (diff)
downloadlibquotient-fb63012ec32c98c663802951153207442d1d63df.tar.gz
libquotient-fb63012ec32c98c663802951153207442d1d63df.zip
linkifyUrls(): be more conservative in parsing serverparts
Closes #321.
-rw-r--r--lib/util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util.cpp b/lib/util.cpp
index 17674b84..914358d5 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -50,7 +50,7 @@ static void linkifyUrls(QString& htmlEscapedText)
// An interim liberal implementation of
// https://matrix.org/docs/spec/appendices.html#identifier-grammar
static const QRegularExpression MxIdRegExp(QStringLiteral(
- R"((^|[^<>/])([!#@][-a-z0-9_=/.]{1,252}:[-.a-z0-9]+))"
+ R"((^|[^<>/])([!#@][-a-z0-9_=/.]{1,252}:(?:\w|\.|-)+\.\w+(?::\d{1,5})?))"
), RegExpOptions);
// NOTE: htmlEscapedText is already HTML-escaped! No literal <,>,&,"