diff options
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mod/item.php b/mod/item.php index 48f85f692..fa7720791 100644 --- a/mod/item.php +++ b/mod/item.php @@ -423,19 +423,13 @@ function item_post(&$a) { /** * fix naked links by passing through a callback to see if this is a red site * (already known to us) which will get a zrl, otherwise link with url, add bookmark tag to both. - * First wrap any url which is part of link anchor text already in quotes so we don't double link it. - * e.g. [url=http://foobar.com]something with http://elsewhere.com in it[/url] - * becomes [url=http://foobar.com]something with "http://elsewhere.com" in it[/url] - * otherwise http://elsewhere.com becomes #^[url=http://elsewhere.com]http://elsewhere.com[/url] + * First protect any url inside certain bbcode tags so we don't double link it. */ $body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','red_escape_codeblock',$body); $body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','red_escape_codeblock',$body); $body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','red_escape_codeblock',$body); -// no longer needed -// $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('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','red_unescape_codeblock',$body); @@ -495,6 +489,7 @@ function item_post(&$a) { $private_forum = false; if(count($tags)) { + $first_access_tag = true; foreach($tags as $tag) { // If we already tagged 'Robert Johnson', don't try and tag 'Robert'. @@ -514,6 +509,11 @@ function item_post(&$a) { logger('handle_tag: ' . print_r($success,tue), LOGGER_DEBUG); if(($access_tag) && (! $parent_item)) { logger('access_tag: ' . $tag . ' ' . print_r($access_tag,true), LOGGER_DEBUG); + if ($first_access_tag) { + $str_contact_allow = ''; + $str_group_allow = ''; + $first_access_tag = false; + } if(strpos($access_tag,'cid:') === 0) { $str_contact_allow .= '<' . substr($access_tag,4) . '>'; $access_tag = ''; |