diff --git a/web/pages/admin.bans.php b/web/pages/admin.bans.php
index fe65e4220..017d75f66 100644
--- a/web/pages/admin.bans.php
+++ b/web/pages/admin.bans.php
@@ -1346,7 +1346,7 @@ function bansBuildComments(array $commentres, $userbank, int $rowId, string $typ
$cdata['added'] = Config::time($crow['added']);
$commentText = html_entity_decode($crow['commenttxt'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
$commentText = encodePreservingBr($commentText);
- $commentText = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '$1', $commentText);
+ $commentText = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@', '$1', $commentText);
$cdata['commenttxt'] = $commentText;
if (!empty($crow['edittime'])) {
diff --git a/web/pages/page.banlist.php b/web/pages/page.banlist.php
index 0a1ae0bc0..681722c65 100644
--- a/web/pages/page.banlist.php
+++ b/web/pages/page.banlist.php
@@ -1123,7 +1123,7 @@ function setPostKey()
$commentText = html_entity_decode($crow['commenttxt'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
$commentText = encodePreservingBr($commentText);
// Parse links and wrap them in a tag to be easily clickable
- $commentText = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '$1', $commentText);
+ $commentText = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@', '$1', $commentText);
$cdata['commenttxt'] = $commentText;
if (!empty($crow['edittime'])) {
diff --git a/web/pages/page.commslist.php b/web/pages/page.commslist.php
index 6c97490be..361eb1128 100644
--- a/web/pages/page.commslist.php
+++ b/web/pages/page.commslist.php
@@ -902,7 +902,7 @@ function setPostKey()
$commentText = html_entity_decode($crow['commenttxt'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
$commentText = encodePreservingBr($commentText);
// Parse links and wrap them in a tag to be easily clickable
- $commentText = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '$1', $commentText);
+ $commentText = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@', '$1', $commentText);
$cdata['commenttxt'] = $commentText;
if (!empty($crow['edittime'])) {