From 6f1590fcafe7904a50b888de2f2baff5b1a85f41 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 14 Jun 2019 17:19:52 +0200 Subject: [PATCH] fix unescaped dash in regular expression --- api/src/Html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Html.php b/api/src/Html.php index 9c8d132d45..4cca2218a9 100644 --- a/api/src/Html.php +++ b/api/src/Html.php @@ -61,7 +61,7 @@ class Html { // First match things beginning with http:// (or other protocols) $Protocol = '(http:\/\/|(ftp:\/\/|https:\/\/))'; // only http:// gets removed, other protocolls are shown - $Domain = '([\w-]+\.[\w-.]+)'; + $Domain = '([\w-]+\.[\w\-.]+)'; $Subdir = '([\w\-\.,@?^=%&;:\/~\+#]*[\w\-\@?^=%&\/~\+#])?'; $optStuff = '("|"|;)?'; $Expr = '/' . $NotAnchor . $Protocol . $Domain . $Subdir . $optStuff . '/i'; @@ -92,7 +92,7 @@ class Html // Now match things beginning with www. $optBracket0 = '(<|<)?'; $NotHTTP = '(?)'; // avoid running again on http://www links already handled above - $Domain2 = 'www(\.[\w-.]+)'; + $Domain2 = 'www(\.[\w\-.]+)'; $Subdir2 = '([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?'; $optBracket = '(>|>|>|;)?'; $Expr = '/' .$optBracket0. $NotAnchor . $NotHTTP . $Domain2 . $Subdir2 .$optBracket. '/i';