From 051747f1147652675351eab4755ec4f1da1d93a0 Mon Sep 17 00:00:00 2001 From: troy Date: Sat, 7 Aug 2021 09:10:26 +0200 Subject: [PATCH] linkify bugfix --- string.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/string.php b/string.php index 7b50b53..4b5c8c3 100644 --- a/string.php +++ b/string.php @@ -258,8 +258,8 @@ function onlySimpleHTML($s) { return $s; } function linkify($input) { - $pattern = '@(http(s)?://)?(([a-zA-Z])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])@'; - return $output = preg_replace ( $pattern, '$0', $input ); + $pattern = '@(http(s)?://[a-zA-Z0-9/\.\#\-\_]*)@'; + return $output = preg_replace ( $pattern, '$1', $input ); } function inStr($needle, $haystack) { if (strpos ( $haystack, $needle ) !== false) {