Ward against null value in language key of item array in Mastodon\Status object

- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936
This commit is contained in:
Hypolite Petovan 2022-12-19 10:11:12 -05:00
parent b1b0bfc280
commit 6a17223289

View File

@ -114,7 +114,7 @@ class Status extends BaseDataTransferObject
$visibility = ['public', 'private', 'unlisted']; $visibility = ['public', 'private', 'unlisted'];
$this->visibility = $visibility[$item['private']]; $this->visibility = $visibility[$item['private']];
$languages = json_decode($item['language'], true); $languages = json_decode($item['language'] ?? '', true);
if (is_array($languages)) { if (is_array($languages)) {
reset($languages); reset($languages);
$this->language = key($languages); $this->language = key($languages);