From 1cf67f4f714be45cf93302f223a58c65402e3038 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 2 Nov 2009 12:57:51 -0500 Subject: [PATCH] allow <> to surround the url (like () or []) --- lib/util.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index 31a78a876a..ed7e10f6bd 100644 --- a/lib/util.php +++ b/lib/util.php @@ -422,7 +422,7 @@ function common_render_text($text) function common_replace_urls_callback($text, $callback, $notice_id = null) { // Start off with a regex $regex = '#'. - '(?:^|[\s\(\)\[\]\{\}\\\'\\\";]+)(?![\@\!\#])'. + '(?:^|[\s\<\>\(\)\[\]\{\}\\\'\\\";]+)(?![\@\!\#])'. '('. '(?:'. '(?:'. //Known protocols @@ -480,6 +480,10 @@ function callback_helper($matches, $callback, $notice_id) { array( 'left'=>'{', 'right'=>'}' + ), + array( + 'left'=>'<', + 'right'=>'>' ) ); $cannotEndWith=array('.','?',',','#');