aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php8
-rw-r--r--include/markdown.php2
-rw-r--r--include/text.php4
3 files changed, 8 insertions, 6 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 7ebc8d37c..fd476766e 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -707,10 +707,12 @@ function parseIdentityAwareHTML($Text) {
return $Text;
}
- // BBcode 2 HTML was written by WAY2WEB.net
- // extended to work with Mistpark/Friendica/Redmatrix/Hubzilla - Mike Macgirvin
-function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) {
+function bbcode($Text, $options = []) {
+
+ $preserve_nl = ((array_key_exists('preserve_nl',$options)) ? $options['preserve_nl'] : false);
+ $tryoembed = ((array_key_exists('tryomebed',$options)) ? $options['tryoembed'] : true);
+ $cache = ((array_key_exists('cache',$options)) ? $options['cache'] : false);
call_hooks('bbcode_filter', $Text);
diff --git a/include/markdown.php b/include/markdown.php
index f398d279e..e4a35e3c3 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -204,7 +204,7 @@ function bb_to_markdown($Text, $options = []) {
$Text = $x['bbcode'];
// Convert it to HTML - don't try oembed
- $Text = bbcode($Text, $preserve_nl, false);
+ $Text = bbcode($Text, [ 'tryoembed' => false ]);
// Markdownify does not preserve previously escaped html entities such as <> and &.
$Text = str_replace(array('&lt;','&gt;','&amp;'),array('&_lt_;','&_gt_;','&_amp_;'),$Text);
diff --git a/include/text.php b/include/text.php
index 343e3f00b..f3d522e04 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1679,9 +1679,9 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
require_once('include/bbcode.php');
if(stristr($text,'[nosmile]'))
- $s = bbcode($text,false,true,$cache);
+ $s = bbcode($text, [ 'cache' => $cache ]);
else
- $s = smilies(bbcode($text,false,true,$cache));
+ $s = smilies(bbcode($text, [ 'cache' => $cache ]));
$s = zidify_links($s);