aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-04 16:33:11 -0700
committerzotlabs <mike@macgirvin.com>2018-04-04 16:33:11 -0700
commitf7481396060a5a57cdd5fe7055eed5ad3225f8f1 (patch)
tree927e9594e92c0efa15204419ad6932eb085bac13 /include/text.php
parent8871f8d0f4b33a4ed76ce18c15b7a8fcab916d6e (diff)
downloadvolse-hubzilla-f7481396060a5a57cdd5fe7055eed5ad3225f8f1.tar.gz
volse-hubzilla-f7481396060a5a57cdd5fe7055eed5ad3225f8f1.tar.bz2
volse-hubzilla-f7481396060a5a57cdd5fe7055eed5ad3225f8f1.zip
allow the link target attribute to be modified in bbcode() from much further up the call stack in prepare_page() which will usually refer to a local item.
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php
index f634f0d55..658f53305 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1588,7 +1588,7 @@ function generate_named_map($location) {
}
-function prepare_body(&$item,$attach = false) {
+function prepare_body(&$item,$attach = false,$opts = false) {
call_hooks('prepare_body_init', $item);
@@ -1616,7 +1616,7 @@ function prepare_body(&$item,$attach = false) {
$s .= prepare_binary($item);
}
else {
- $s .= prepare_text($item['body'],$item['mimetype'], false);
+ $s .= prepare_text($item['body'],$item['mimetype'], $opts);
}
$event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : false);
@@ -1698,7 +1698,8 @@ function prepare_binary($item) {
*
* @return string
*/
-function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
+function prepare_text($text, $content_type = 'text/bbcode', $opts = false) {
+
switch($content_type) {
case 'text/plain':
@@ -1742,7 +1743,7 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
if(stristr($text,'[nosmile]'))
$s = bbcode($text, [ 'cache' => $cache ]);
else
- $s = smilies(bbcode($text, [ 'cache' => $cache ]));
+ $s = smilies(bbcode($text, ((is_array($opts)) ? $opts : [] )));
$s = zidify_links($s);