Correct parameter in include/text.php prepare_text()
Also extend documentation.
This commit is contained in:
parent
ca9c29e2b6
commit
ae538a2259
@ -1729,17 +1729,24 @@ function prepare_binary($item) {
|
||||
|
||||
|
||||
/**
|
||||
* @brief Given a text string, convert from bbcode to html and add smilie icons.
|
||||
* @brief Given a text string, convert from content_type to HTML.
|
||||
*
|
||||
* Take a text in plain text, html, markdown, bbcode, PDL or PHP and prepare
|
||||
* it to return HTML.
|
||||
*
|
||||
* In bbcode this function will add smilie icons.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string $content_type (optional) default text/bbcode
|
||||
* @param boolean $cache (optional) default false
|
||||
*
|
||||
* @param string $content_type (optional)
|
||||
* default 'text/bbcode', other values are 'text/plain', 'text/html',
|
||||
* 'text/markdown', 'application/x-pdl', 'application/x-php'
|
||||
* @param boolean|array $opts (optional)
|
||||
* default false, otherwise configuration array for bbcode()
|
||||
* @return string
|
||||
* The parsed $text as prepared HTML.
|
||||
*/
|
||||
function prepare_text($text, $content_type = 'text/bbcode', $opts = false) {
|
||||
|
||||
|
||||
switch($content_type) {
|
||||
case 'text/plain':
|
||||
$s = escape_tags($text);
|
||||
@ -1779,8 +1786,8 @@ function prepare_text($text, $content_type = 'text/bbcode', $opts = false) {
|
||||
default:
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
if(stristr($text,'[nosmile]'))
|
||||
$s = bbcode($text, [ 'cache' => $cache ]);
|
||||
if(stristr($text, '[nosmile]'))
|
||||
$s = bbcode($text, ((is_array($opts)) ? $opts : [] ));
|
||||
else
|
||||
$s = smilies(bbcode($text, ((is_array($opts)) ? $opts : [] )));
|
||||
|
||||
|
Reference in New Issue
Block a user