summary refs log tree commit diff
path: root/src/Config.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-03-31 01:29:18 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-03-31 01:29:18 +0200
commit164de9c21c54a760680f141461f8849713d7cc3a (patch)
tree45c77c2f532f638280107f86a35ca01259fcd2b5 /src/Config.h
parentMerge pull request #1411 from dtelsing/screenshare-xdg-desktop-portal (diff)
downloadnheko-164de9c21c54a760680f141461f8849713d7cc3a.tar.xz
Allow for # in fragments because some clients send matrix.to links like that
Diffstat (limited to '')
-rw-r--r--src/Config.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Config.h b/src/Config.h
index a129321f..02761435 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -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 +
              "?"