change to bbcode calling parameters: important: will require pulling addons;
also some extra checking of server headers in upload functions
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user