]> git.mxchange.org Git - friendica.git/commitdiff
Ward against null value in language key of item array in Mastodon\Status object
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 19 Dec 2022 15:11:12 +0000 (10:11 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 19 Dec 2022 15:11:12 +0000 (10:11 -0500)
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936

src/Object/Api/Mastodon/Status.php

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