Skip to content
Snippets Groups Projects
Verified Commit 164de9c2 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Allow for # in fragments because some clients send matrix.to links like that

parent 5de73083
No related branches found
No related tags found
No related merge requests found
Pipeline #4696 passed
......@@ -61,7 +61,9 @@ inline const QRegularExpression url_regex(
general_unicode + ")*))";
const auto query = R"(((?:[a-zA-Z0-9\-._~!$&'*+,;=:@/?\\{}]|)" + pct_enc +
R"(|\((?-1)\)|\[(?-1)\]|)" + general_unicode + ")*)";
const auto &fragment = query;
// explicitly allow # in fragments because of matrix.to urls generated by some clients...
const auto fragment = R"(((?:[a-zA-Z0-9\-._~!$&'*+,;=:@/?\\{}#]|)" + pct_enc +
R"(|\((?-1)\)|\[(?-1)\]|)" + general_unicode + ")*)";
return R"((?<!["'\w])(?>()" + protocol + "://" + "(?:" + userinfo + "@)?" + host +
"(?::[0-9]+)?" + path +
"?"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment