Browse Source

Merge pull request #10305 from annando/warnings

Fix warning "reset() expects parameter 1 to be array, null given"
pull/10307/head
Tobias Diekershoff 6 months ago
committed by GitHub
parent
commit
280d0ee961
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/Object/Api/Mastodon/Status.php

8
src/Object/Api/Mastodon/Status.php

@ -114,8 +114,12 @@ class Status extends BaseDataTransferObject
$this->visibility = $visibility[$item['private']];
$languages = json_decode($item['language'], true);
reset($languages);
$this->language = is_array($languages) ? key($languages) : null;
if (is_array($languages)) {
reset($languages);
$this->language = key($languages);
} else {
$this->language = null;
}
$this->uri = $item['uri'];
$this->url = $item['plink'] ?? null;

Loading…
Cancel
Save