mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:55:19 +00:00
Merge branch 'dev' of /home/macgirvin/z into dev
This commit is contained in:
commit
eba98f3d0e
1 changed files with 10 additions and 0 deletions
|
@ -1323,6 +1323,9 @@ function bbcode($Text, $options = []) {
|
|||
// Replace any html brackets with HTML Entities to prevent executing HTML or script
|
||||
// Don't use strip_tags here because it breaks [url] search by replacing & with amp
|
||||
|
||||
// experimental.... not yet working
|
||||
// $Text = purify_html($Text);
|
||||
|
||||
$Text = str_replace("<", "<", $Text);
|
||||
$Text = str_replace(">", ">", $Text);
|
||||
|
||||
|
@ -1343,6 +1346,13 @@ function bbcode($Text, $options = []) {
|
|||
|
||||
if (! $bbonly) {
|
||||
|
||||
// escape some frequently encountered false positives with a zero-width space
|
||||
|
||||
// Here we are catching things like [quote](something)[/quote] and [b](something)[/b] and preventing them from turning into broken markdown links [text](url)
|
||||
// We'll do this with a zero-width space between ] and (
|
||||
$Text = preg_replace("/\[(.*?)\]\((.*?)\)\[\/(.*?)\]/ism", '[$1]' . html_entity_decode('​') . '($2)[/$3]', $Text);
|
||||
|
||||
|
||||
// save code blocks from being interpreted as markdown
|
||||
|
||||
$Text = preg_replace_callback("/\[code(.*?)\](.*?)\[\/code\]/ism", 'bb_code_preprotect', $Text);
|
||||
|
|
Loading…
Reference in a new issue