Accepting "!"-links as tags. (They are used at statusnet for groups)

This commit is contained in:
Michael Vogel 2014-04-22 15:54:56 +02:00
parent b6384ec5be
commit b64ddcce96
1 changed files with 2 additions and 2 deletions

View File

@ -749,7 +749,7 @@ function get_tags($s) {
// Otherwise pull out single word tags. These can be @nickname, @first_last // Otherwise pull out single word tags. These can be @nickname, @first_last
// and #hash tags. // and #hash tags.
if(preg_match_all('/([@#][^ \x0D\x0A,;:?]+)([ \x0D\x0A,;:?]|$)/',$s,$match)) { if(preg_match_all('/([!#@][^ \x0D\x0A,;:?]+)([ \x0D\x0A,;:?]|$)/',$s,$match)) {
foreach($match[1] as $mtch) { foreach($match[1] as $mtch) {
if(strstr($mtch,"]")) { if(strstr($mtch,"]")) {
// we might be inside a bbcode color tag - leave it alone // we might be inside a bbcode color tag - leave it alone
@ -2168,7 +2168,7 @@ function normalise_openid($s) {
function undo_post_tagging($s) { function undo_post_tagging($s) {
$matches = null; $matches = null;
$cnt = preg_match_all('/([@#])\[url=(.*?)\](.*?)\[\/url\]/ism',$s,$matches,PREG_SET_ORDER); $cnt = preg_match_all('/([!#@])\[url=(.*?)\](.*?)\[\/url\]/ism',$s,$matches,PREG_SET_ORDER);
if($cnt) { if($cnt) {
foreach($matches as $mtch) { foreach($matches as $mtch) {
$s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s); $s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s);