summaryrefslogtreecommitdiffstats
path: root/4345913413bf411db8f4a758221e865c5fd6e4bd.patch
blob: b10e5bf3aaea6bcf63321bd1795634d7f4848f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 4345913413bf411db8f4a758221e865c5fd6e4bd Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 15 Oct 2018 08:28:23 +0200
Subject: [PATCH] protect the -, this is not a range

---
 lib/Horde/Text/Filter/Emails.php   | 2 +-
 lib/Horde/Text/Filter/Linkurls.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Horde/Text/Filter/Emails.php b/lib/Horde/Text/Filter/Emails.php
index 49468ab..86447fc 100644
--- a/lib/Horde/Text/Filter/Emails.php
+++ b/lib/Horde/Text/Filter/Emails.php
@@ -61,7 +61,7 @@ public function getPatterns()
             ((?(1)\s*\]))
         |
             # Version 2 Pattern 9 and 10: simple email addresses.
-            (^|\s|&lt;|<|\[)([\w-+.=]+@[-A-Z0-9.]*[A-Z0-9])
+            (^|\s|&lt;|<|\[)([\w\-+.=]+@[-A-Z0-9.]*[A-Z0-9])
             # Pattern 11 to 13: Optional parameters
             ((\?)([^\s"<]*[\w+#?\/&=]))?
             # Pattern 14: Optional closing bracket
diff --git a/lib/Horde/Text/Filter/Linkurls.php b/lib/Horde/Text/Filter/Linkurls.php
index ceb9134..f579587 100644
--- a/lib/Horde/Text/Filter/Linkurls.php
+++ b/lib/Horde/Text/Filter/Linkurls.php
@@ -86,7 +86,7 @@ public static function initializeRegex()
 (?:\b|^)
 (  # Capture 1: entire matched URL
   (
-   (?:[a-z][\w-+]{0,19})?:/{1,3}  # URL protocol and colon followed by 1-3
+   (?:[a-z][\w\-+]{0,19})?:/{1,3}  # URL protocol and colon followed by 1-3
                                   # slashes, or just colon and slashes (://)
     |                             #  - or -
     (?<!\.)www\d{0,3}\.           # "www.", "www1.", "www2." … "www999."