diff options
author | nobody <nobody@zotlabs.com> | 2021-02-24 11:38:38 -0800 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2021-02-24 11:38:38 -0800 |
commit | beb418b093913bcc9499dac2722d53dfdab4879d (patch) | |
tree | 739ca3d948cb5574c479289f54cdceba707c7f58 /include/bbcode.php | |
parent | 0f89d2b8e06de56effc5e5f751c098a432e26e6a (diff) | |
parent | a033c439f3486c6ce31fb5d680c363ce0582d451 (diff) | |
download | volse-hubzilla-beb418b093913bcc9499dac2722d53dfdab4879d.tar.gz volse-hubzilla-beb418b093913bcc9499dac2722d53dfdab4879d.tar.bz2 volse-hubzilla-beb418b093913bcc9499dac2722d53dfdab4879d.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 4580516a5..5a71ada0c 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -272,6 +272,26 @@ function bb_parse_crypt($match) { return $Text; } +/** + * @brief Returns raw base64 encoded crypt content. + * + * @param array $match + * @return string + */ +function bb_parse_b64_crypt($match) { + + if(empty($match[2])) + return; + + $r .= '----- ENCRYPTED CONTENT -----' . PHP_EOL; + $r .= $match[2] . PHP_EOL; + $r .= '----- END ENCRYPTED CONTENT -----'; + + return $r; + +} + + function bb_parse_app($match) { $app = Zotlabs\Lib\Apps::app_decode($match[1]); @@ -1204,9 +1224,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); |