diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-17 23:28:58 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-17 23:28:58 -0700 |
commit | 654139933fe1ed9527bd4a7f3dbb82abf6952388 (patch) | |
tree | 27d78001e0e5dd49e9ce3a41c187ecdfb6d3c489 /include/text.php | |
parent | 1d9e0f17a6e945a10c05ad6543682ad1c8cd87d9 (diff) | |
download | volse-hubzilla-654139933fe1ed9527bd4a7f3dbb82abf6952388.tar.gz volse-hubzilla-654139933fe1ed9527bd4a7f3dbb82abf6952388.tar.bz2 volse-hubzilla-654139933fe1ed9527bd4a7f3dbb82abf6952388.zip |
tagging changes
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php index c4d441e85..ce0352d8d 100644 --- a/include/text.php +++ b/include/text.php @@ -794,7 +794,7 @@ function get_tags($s) { // match any double quoted tags - if(preg_match_all('/([@#]\"\;.*?\"\;)/',$s,$match)) { + if(preg_match_all('/([@#!]\"\;.*?\"\;)/',$s,$match)) { foreach($match[1] as $mtch) { $ret[] = $mtch; } @@ -823,7 +823,7 @@ function get_tags($s) { // Otherwise pull out single word tags. These can be @nickname, @first_last // and #hash tags. - if(preg_match_all('/(?<![a-zA-Z0-9=\/\?\;])([@#][^ \x0D\x0A,;:?\[]+)/',$s,$match)) { + if(preg_match_all('/(?<![a-zA-Z0-9=\/\?\;])([@#!][^ \x0D\x0A,;:?\[]+)/',$s,$match)) { foreach($match[1] as $mtch) { if(substr($mtch,-1,1) === '.') $mtch = substr($mtch,0,-1); @@ -2385,6 +2385,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d $termtype = ((strpos($tag,'#') === 0) ? TERM_HASHTAG : TERM_UNKNOWN); $termtype = ((strpos($tag,'@') === 0) ? TERM_MENTION : $termtype); + $termtype = ((strpos($tag,'!') === 0) ? TERM_MENTION : $termtype); $termtype = ((strpos($tag,'#^[') === 0) ? TERM_BOOKMARK : $termtype); //is it a hash tag? @@ -2441,10 +2442,16 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d //is it a person tag? - if(strpos($tag,'@') === 0) { + $grouptag = false; + + if(strpos($tag,'!') === 0) { + $grouptag = true; + + + if(strpos($tag,'@') === 0 || $grouptag) { // The @! tag will alter permissions - $exclusive = ((strpos($tag,'!') === 1 && (! $diaspora)) ? true : false); + $exclusive = (((! $grouptag) && (strpos($tag,'!') === 1) && (! $diaspora)) ? true : false); //is it already replaced? if(strpos($tag,'[zrl=')) |