don't add bookmark tags to naked links inside code blocks
This commit is contained in:
parent
eb96a04d34
commit
a76c53657b
@ -179,6 +179,15 @@ function red_escape_zrl_callback($matches) {
|
|||||||
return '[' . $matches[1] . 'rl' . $matches[2] . ']' . $matches[3] . '"' . $matches[4] . '"' . $matches[5] . '[/' . $matches[6] . 'rl]';
|
return '[' . $matches[1] . 'rl' . $matches[2] . ']' . $matches[3] . '"' . $matches[4] . '"' . $matches[5] . '[/' . $matches[6] . 'rl]';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function red_escape_codeblock($m) {
|
||||||
|
return '[code]' . base64_encode($m[1]) . '[/code]';
|
||||||
|
}
|
||||||
|
|
||||||
|
function red_unescape_codeblock($m) {
|
||||||
|
return '[code]' . base64_decode($m[1]) . '[/code]';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function post_activity_item($arr)
|
* @function post_activity_item($arr)
|
||||||
*
|
*
|
||||||
|
@ -429,10 +429,15 @@ function item_post(&$a) {
|
|||||||
* otherwise http://elsewhere.com becomes #^[url=http://elsewhere.com]http://elsewhere.com[/url]
|
* 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('/\[([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("/([^\]\='".'"'."]|^|\#\^)(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
|
* When a photo was uploaded into the message using the (profile wall) ajax
|
||||||
|
@ -1 +1 @@
|
|||||||
2014-02-09.583
|
2014-02-10.584
|
||||||
|
Reference in New Issue
Block a user