[tumblr] Ward against unexpected response format in tumblr_fetch_tags()

- Adress https://github.com/friendica/friendica/issues/14646#issuecomment-2628090487
develop^2
Hypolite Petovan 2025-02-06 20:50:40 -05:00 committed by Tobias Diekershoff
parent 4454ce5883
commit 373c30b5d0
1 changed files with 6 additions and 0 deletions

View File

@ -743,6 +743,12 @@ function tumblr_fetch_tags(int $uid, int $last_poll)
foreach (DI::pConfig()->get($uid, 'tumblr', 'tags') ?? [] as $tag) {
$data = tumblr_get($uid, 'tagged', ['tag' => $tag]);
if (!is_array($data->response)) {
DI::logger()->warning('Unexpected Tumblr response format', ['uid' => $uid, 'url' => 'tagged', 'parameters' => ['tag' => $tag], 'data' => $data]);
continue;
}
foreach (array_reverse($data->response) as $post) {
$id = tumblr_process_post($post, $uid, Item::PR_TAG, $last_poll);
if (!empty($id)) {