mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-02-15 17:34:02 +00:00
Merge pull request '[tumblr] Ward against unexpected response format in tumblr_fetch_tags()' (#1599) from MrPetovan/friendica-addons:bug/fatal-errors into develop
Reviewed-on: https://git.friendi.ca/friendica/friendica-addons/pulls/1599
This commit is contained in:
commit
0fb2c05244
1 changed files with 6 additions and 0 deletions
|
@ -743,6 +743,12 @@ function tumblr_fetch_tags(int $uid, int $last_poll)
|
||||||
|
|
||||||
foreach (DI::pConfig()->get($uid, 'tumblr', 'tags') ?? [] as $tag) {
|
foreach (DI::pConfig()->get($uid, 'tumblr', 'tags') ?? [] as $tag) {
|
||||||
$data = tumblr_get($uid, 'tagged', ['tag' => $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) {
|
foreach (array_reverse($data->response) as $post) {
|
||||||
$id = tumblr_process_post($post, $uid, Item::PR_TAG, $last_poll);
|
$id = tumblr_process_post($post, $uid, Item::PR_TAG, $last_poll);
|
||||||
if (!empty($id)) {
|
if (!empty($id)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue