From 2957bccb33fe36b426feb88eedfc675a3b03a28c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 8 Sep 2021 21:30:21 +0200 Subject: [PATCH] Revert "Fixing trailing characters treated as part of URI error (#3938)." This reverts commit 8d45cc5827f9fb3f6535749cc7d5c624fc08f5b5. --- .../java/eu/siacs/conversations/utils/Patterns.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/Patterns.java b/src/main/java/eu/siacs/conversations/utils/Patterns.java index 02a437345..026951b22 100644 --- a/src/main/java/eu/siacs/conversations/utils/Patterns.java +++ b/src/main/java/eu/siacs/conversations/utils/Patterns.java @@ -337,15 +337,9 @@ public class Patterns { + "\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_" + "\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@"; private static final String PORT_NUMBER = "\\:\\d{1,5}"; - private static final String PATH_AND_QUERY_CHARS_WITHOUT_SLASH = - "\\;\\?\\:\\@\\&\\=\\#\\~" // plus optional query params - + "\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_\\$"; private static final String PATH_AND_QUERY = "\\/(?:(?:[" + LABEL_CHAR - + PATH_AND_QUERY_CHARS_WITHOUT_SLASH - + "]+[^" + PATH_AND_QUERY_CHARS_WITHOUT_SLASH + "\\s]" // path and query chars must not be trailing - + "|\\/" // trailing slashes are fine - + ")|(?:\\%[a-fA-F0-9]{2}))*"; - + + "\\;\\/\\?\\:\\@\\&\\=\\#\\~" // plus optional query params + + "\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_\\$])|(?:\\%[a-fA-F0-9]{2}))*"; /** * Regular expression pattern to match most part of RFC 3987 * Internationalized URLs, aka IRIs. @@ -516,4 +510,4 @@ public class Patterns { * Do not create this static utility class. */ private Patterns() {} -} \ No newline at end of file +}