diff options
author | Max Kostikov <max@kostikov.co> | 2021-03-08 20:52:39 +0000 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2021-03-08 20:52:39 +0000 |
commit | 6b500ee3e111b5b10860edaefc914dc79ff06f61 (patch) | |
tree | 7166d1a3124d1406351d383032c3edc798078069 /Zotlabs/Lib/Activity.php | |
parent | 1ad6308f979572343cffdce83638273a6e210f28 (diff) | |
download | volse-hubzilla-6b500ee3e111b5b10860edaefc914dc79ff06f61.tar.gz volse-hubzilla-6b500ee3e111b5b10860edaefc914dc79ff06f61.tar.bz2 volse-hubzilla-6b500ee3e111b5b10860edaefc914dc79ff06f61.zip |
Check if BBcode field exist
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index d28f5631d..d8e3b7947 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3372,22 +3372,25 @@ class Activity { require_once('include/event.php'); $ret = false; - if (is_array($content[$field])) { - foreach ($content[$field] as $k => $v) { - $ret .= html2bbcode($v); - // save this for auto-translate or dynamic filtering - // $ret .= '[language=' . $k . ']' . html2bbcode($v) . '[/language]'; - } - } - else { - if ($field === 'bbcode' && array_key_exists('bbcode', $content)) { - $ret = $content[$field]; + if (array_key_exists($field, $content)) { + if (is_array($content[$field])) { + foreach ($content[$field] as $k => $v) { + $ret .= html2bbcode($v); + // save this for auto-translate or dynamic filtering + // $ret .= '[language=' . $k . ']' . html2bbcode($v) . '[/language]'; + } } else { - $ret = html2bbcode($content[$field]); + if ($field === 'bbcode' && array_key_exists('bbcode', $content)) { + $ret = $content[$field]; + } + else { + $ret = html2bbcode($content[$field]); + } } } - if ($field === 'content' && $content['event'] && (!strpos($ret, '[event'))) { + + if ($field === 'content' && array_key_exists('event', $content) && (!strpos($ret, '[event'))) { $ret .= format_event_bbcode($content['event']); } |