From a76c53657bca9ea6aa2246535f117f7043bb5205 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 10 Feb 2014 01:11:59 -0800 Subject: don't add bookmark tags to naked links inside code blocks --- mod/item.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 69cc624ea..784ee31b4 100644 --- a/mod/item.php +++ b/mod/item.php @@ -429,10 +429,15 @@ function item_post(&$a) { * otherwise http://elsewhere.com becomes #^[url=http://elsewhere.com]http://elsewhere.com[/url] */ + $body = preg_replace_callback('/\[code\](.*?)\[\/code\]/ism','red_escape_codeblock',$body); + $body = preg_replace_callback('/\[([uz])rl(.*?)\](.*?)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)(.*?)\[\/([uz])rl\]/ism','red_escape_zrl_callback',$body); $body = preg_replace_callback("/([^\]\='".'"'."]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)/ism", 'red_zrl_callback', $body); + $body = preg_replace_callback('/\[code\](.*?)\[\/code\]/ism','red_unescape_codeblock',$body); + + /** * * When a photo was uploaded into the message using the (profile wall) ajax -- cgit v1.2.3