aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2021-03-08 20:52:39 +0000
committerMax Kostikov <max@kostikov.co>2021-03-08 20:52:39 +0000
commit6b500ee3e111b5b10860edaefc914dc79ff06f61 (patch)
tree7166d1a3124d1406351d383032c3edc798078069 /Zotlabs
parent1ad6308f979572343cffdce83638273a6e210f28 (diff)
downloadvolse-hubzilla-6b500ee3e111b5b10860edaefc914dc79ff06f61.tar.gz
volse-hubzilla-6b500ee3e111b5b10860edaefc914dc79ff06f61.tar.bz2
volse-hubzilla-6b500ee3e111b5b10860edaefc914dc79ff06f61.zip
Check if BBcode field exist
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Activity.php27
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']);
}