From 8dbea39e0a49b54cb053440bc74260d40972d065 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 28 Feb 2019 10:31:06 -0800 Subject: [PATCH] Fixes #3699 makeClickable issue on PHP 7.3 --- e107_handlers/e_parse_class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index f2c8e4988..1b1f3efb8 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -1465,11 +1465,12 @@ class e_parse extends e_parser case "url": - $linktext = (!empty($textReplace)) ? $textReplace : '\\2'; - $external = (!empty($opts['ext'])) ? 'rel="external"' : ''; + $linktext = (!empty($textReplace)) ? $textReplace : '$3'; + $external = (!empty($opts['ext'])) ? 'target="_blank"' : ''; - $text = preg_replace("#(^|[\s]| )([\w]+?:\/\/(?:[\w-%]+?)(?:\.[\w-%]+?)+.*?)(?=$|[\s[\]<]|\.\s|\.$|,\s|,$| )#is", "\\1".$linktext."", $text); - $text = preg_replace("#(^|[\s])((?:www|ftp)(?:\.[\w-%]+?){2}.*?)(?=$|[\s[\]<]|\.\s|\.$|,\s|,$)#is", "\\1".$linktext."", $text); + $text= preg_replace("/(^|[\n \(])([\w]*?)([\w]*?:\/\/[\w]+[^ \,\"\n\r\t<]*)/is", "$1$2".$linktext."", $text); + $text= preg_replace("/(^|[\n \(])([\w]*?)((www)\.[^ \,\"\t\n\r\)<]*)/is", "$1$2".$linktext."", $text); + $text= preg_replace("/(^|[\n ])([\w]*?)((ftp)\.[^ \,\"\t\n\r<]*)/is", "$1$2".$linktext."", $text); break;