fix bbcode links for bang-tag groups

This commit is contained in:
Mike Macgirvin 2024-04-21 09:57:19 +10:00
parent 95fe674c76
commit f676875b6b
2 changed files with 3 additions and 1 deletions

View file

@ -1767,6 +1767,7 @@ function bbcode($Text, $options = [])
$Text = preg_replace("/\#\[url\=([$URLSearchString]*?)\](.*?)\[\/url\]/ism", '#<a class="hashtag" href="$1" ' . $target . ' rel="nofollow noopener" >$2</a>', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*?)\[\/url\]/ism", '<a href="$1" ' . $target . ' rel="nofollow noopener" >$1</a>', $Text);
$Text = preg_replace("/\@(\!?)\[url\=([$URLSearchString]*?)\](.*?)\[\/url\]/ism", '@$1<span class="h-card"><a class="u-url mention" href="$2" ' . $target . ' rel="nofollow noopener" >$3</a></span>', $Text);
$Text = preg_replace("/\!(\!?)\[url\=([$URLSearchString]*?)\](.*?)\[\/url\]/ism", '!$1<span class="h-card"><a class="u-url mention" href="$2" ' . $target . ' rel="nofollow noopener" >$3</a></span>', $Text);
$Text = preg_replace("/\[url\=([$URLSearchString]*?)\](.*?)\[\/url\]/ism", '<a href="$1" ' . $target . ' rel="nofollow noopener" >$2</a>', $Text);
}
@ -1778,6 +1779,7 @@ function bbcode($Text, $options = [])
$Text = preg_replace("/\#\[zrl\=([$URLSearchString]*?)\](.*?)\[\/zrl\]/ism", '#<a class="zrl hashtag" href="$1" ' . $target . ' rel="nofollow noopener" >$2</a>', $Text);
$Text = preg_replace("/\[zrl\]([$URLSearchString]*?)\[\/zrl\]/ism", '<a class="zrl" href="$1" ' . $target . ' rel="nofollow noopener" >$1</a>', $Text);
$Text = preg_replace("/\@(\!?)\[zrl\=([$URLSearchString]*?)\](.*?)\[\/zrl\]/ism", '@$1<span class="h-card"><a class="zrl u-url mention" href="$2" ' . $target . ' rel="nofollow noopener" >$3</a></span>', $Text);
$Text = preg_replace("/\!(\!?)\[zrl\=([$URLSearchString]*?)\](.*?)\[\/zrl\]/ism", '!$1<span class="h-card"><a class="zrl u-url mention" href="$2" ' . $target . ' rel="nofollow noopener" >$3</a></span>', $Text);
$Text = preg_replace("/\[zrl\=([$URLSearchString]*?)\](.*?)\[\/zrl\]/ism", '<a class="zrl" href="$1" ' . $target . ' rel="nofollow noopener" >$2</a>', $Text);
}

View file

@ -1836,7 +1836,7 @@ function prepare_body(&$item, $attach = false, $opts = false)
$s .= prepare_text('[summary]&#8203;' . $item['summary'] . '[/summary]&#8203;' . $item['body'], $item['mimetype'], $opts);
} else {
if ($item['html']) {
$s .= smilies($item['html']);
$s .= smilies(zidify_links($item['html']));
} else {
$s .= prepare_text($item['body'], $item['mimetype'], $opts);
}