diff options
author | Mario <mario@mariovavti.com> | 2021-02-19 07:41:29 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-02-19 07:41:29 +0000 |
commit | 863d4d83a1708daa5cf9a1466681215f5b101b9d (patch) | |
tree | 08c7f699dd52d01a9f53442b878ec3ff7db6b9ed /include/bbcode.php | |
parent | d50381c9c67e097cf3eae73f0311191acca8f0a5 (diff) | |
download | volse-hubzilla-863d4d83a1708daa5cf9a1466681215f5b101b9d.tar.gz volse-hubzilla-863d4d83a1708daa5cf9a1466681215f5b101b9d.tar.bz2 volse-hubzilla-863d4d83a1708daa5cf9a1466681215f5b101b9d.zip |
fix recursive shares
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 4580516a5..584f3adb8 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1204,9 +1204,12 @@ function bbcode($Text, $options = []) { $Text = preg_replace("/([^\]\='".'"'."\;\/]|^|\#\^)(https?\:\/\/$urlchars+)/ismu", '$1<a href="$2" ' . $target . ' rel="nofollow noopener">$2</a>', $Text); } - if (strpos($Text,'[/share]') !== false) { + $count = 0; + while (strpos($Text,'[/share]') !== false && $count < 10) { $Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism", 'bb_ShareAttributes', $Text); + $count ++; } + if($tryoembed) { if (strpos($Text,'[/url]') !== false) { $Text = preg_replace_callback("/[^\^]\[url\]([$URLSearchString]*)\[\/url\]/ism", 'tryoembed', $Text); |