let normal hashtags be quoted strings also
This commit is contained in:
parent
5cb7e48dad
commit
d7aaff459f
@ -574,9 +574,20 @@ function get_tags($s) {
|
|||||||
|
|
||||||
$s = preg_replace('/\[style=(.*?)\]/sm','',$s);
|
$s = preg_replace('/\[style=(.*?)\]/sm','',$s);
|
||||||
|
|
||||||
|
// match any double quoted tags
|
||||||
|
|
||||||
|
if(preg_match_all('/([@#]\"\;.*?\"\;)/',$s,$match)) {
|
||||||
|
foreach($match[1] as $mtch) {
|
||||||
|
$ret[] = $mtch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Match full names against @tags including the space between first and last
|
// Match full names against @tags including the space between first and last
|
||||||
// We will look these up afterward to see if they are full names or not recognisable.
|
// We will look these up afterward to see if they are full names or not recognisable.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(preg_match_all('/(@[^ \x0D\x0A,:?]+ [^ \x0D\x0A@,:?]+)([ \x0D\x0A@,:?]|$)/',$s,$match)) {
|
if(preg_match_all('/(@[^ \x0D\x0A,:?]+ [^ \x0D\x0A@,:?]+)([ \x0D\x0A@,:?]|$)/',$s,$match)) {
|
||||||
foreach($match[1] as $mtch) {
|
foreach($match[1] as $mtch) {
|
||||||
if(strstr($mtch,"]")) {
|
if(strstr($mtch,"]")) {
|
||||||
|
@ -922,8 +922,16 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
|
|||||||
$replaced = true;
|
$replaced = true;
|
||||||
}
|
}
|
||||||
if(! $replaced) {
|
if(! $replaced) {
|
||||||
|
|
||||||
//base tag has the tags name only
|
//base tag has the tags name only
|
||||||
|
|
||||||
|
if((substr($tag,0,7) === '#"') && (substr($tag,-6,6) === '"')) {
|
||||||
|
$basetag = substr($tag,7);
|
||||||
|
$basetag = substr($basetag,0,-6);
|
||||||
|
}
|
||||||
|
else
|
||||||
$basetag = str_replace('_',' ',substr($tag,1));
|
$basetag = str_replace('_',' ',substr($tag,1));
|
||||||
|
|
||||||
//create text for link
|
//create text for link
|
||||||
$url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag);
|
$url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag);
|
||||||
$newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]';
|
$newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]';
|
||||||
|
Reference in New Issue
Block a user