From 026ca9168560d1b3113d468119d2e6d397e09c56 Mon Sep 17 00:00:00 2001 From: "Gerard J. Cerchio" Date: Fri, 7 Jun 2019 05:46:44 -0700 Subject: [PATCH] Update Html.php There are malformed regular expressions. Escape the - in the Html expressions. --- api/src/Html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/Html.php b/api/src/Html.php index fad6ed77de..41f32ab474 100644 --- a/api/src/Html.php +++ b/api/src/Html.php @@ -47,7 +47,7 @@ class Html // First match things beginning with http:// (or other protocols) $optBracket0 = '(<|<)'; $Protocol = '(http:\/\/|(ftp:\/\/|https:\/\/))'; // only http:// gets removed, other protocolls are shown - $Domain = '([\w-]+\.[\w\-.]+)'; + $Domain = '([\w\-]+\.[\w\-.]+)'; $Subdir = '([\w\-\.,@?^=%&;:\/~\+#]*[\w\-\@?^=%&\/~\+#])?'; $optBracket = '(>|>)'; $Expr = '/' .$optBracket0. $NotAnchor . $Protocol . $Domain . $Subdir . $optBracket . '/i'; @@ -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';