diff --git a/plugins/ActivityPub/Util/Model/Note.php b/plugins/ActivityPub/Util/Model/Note.php index 18392359ec..9ec59a99a5 100644 --- a/plugins/ActivityPub/Util/Model/Note.php +++ b/plugins/ActivityPub/Util/Model/Note.php @@ -143,10 +143,15 @@ class Note extends Model } // Figure the locale of the note when possible - $locale = array_column($type_note->get('@context'), '@language'); - if ($locale !== []) { - $locale = $locale[0]; - if ($locale === 'und') { + $locale = null; + if (\is_array($type_note->get('@context'))) { + $locale = array_column($type_note->get('@context'), '@language'); + if ($locale !== []) { + $locale = $locale[0]; + if ($locale === 'und') { + $locale = null; + } + } else { $locale = null; } } @@ -178,7 +183,7 @@ class Note extends Model } else { // Either Followers-only or Direct if ($type_note->get('type') === 'ChatMessage' // Is DM explicitly? - || (empty($type_note->get('cc')))) { // Only has TO targets + || ($type_note->get('cc') === [])) { // Only has TO targets $map['scope'] = VisibilityScope::MESSAGE; } else { // Then is collection $map['scope'] = VisibilityScope::COLLECTION;