Tumblr: wrong "page" values are corrected automatically #1369

Merged
MrPetovan merged 2 commits from heluecht/friendica-addons:tumblr-page into 2023.03-rc 2023-04-10 13:37:35 +02:00
Showing only changes of commit 99639632dd - Show all commits

View file

@ -510,8 +510,8 @@ function tumblr_get($connection, string $url)
$data = json_decode($res->getBody()->getContents()); $data = json_decode($res->getBody()->getContents());
} catch (RequestException $exception) { } catch (RequestException $exception) {
$success = false; $success = false;
$data = [];
Logger::notice('Request failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]); Logger::notice('Request failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
$data = json_decode($exception->getResponse()->getBody()->getContents());
} }
return ['success' => $success, 'data' => $data]; return ['success' => $success, 'data' => $data];
} }
@ -525,8 +525,8 @@ function tumblr_post($connection, string $url, array $parameter)
$data = json_decode($res->getBody()->getContents()); $data = json_decode($res->getBody()->getContents());
} catch (RequestException $exception) { } catch (RequestException $exception) {
$success = false; $success = false;
Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
$data = json_decode($exception->getResponse()->getBody()->getContents()); $data = json_decode($exception->getResponse()->getBody()->getContents());
Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
} }
return ['success' => $success, 'data' => $data]; return ['success' => $success, 'data' => $data];
} }