From 8aca42c88273a78849ef71dba6fe838628ece044 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Tue, 2 Mar 2021 11:27:48 -0500 Subject: [PATCH] Minor fixes for correctness --- lib/REST/Miniflux/V1.php | 2 +- lib/REST/TinyTinyRSS/API.php | 2 +- tests/cases/REST/TinyTinyRSS/TestAPI.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/REST/Miniflux/V1.php b/lib/REST/Miniflux/V1.php index 4ac4933..a3854ea 100644 --- a/lib/REST/Miniflux/V1.php +++ b/lib/REST/Miniflux/V1.php @@ -718,7 +718,7 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler { // otherwise we'd be deleting the entire tree $tr = Arsse::$db->begin(); foreach (Arsse::$db->subscriptionList(Arsse::$user->id, null, false) as $sub) { - Arsse::$db->subscriptionRemove(Arsse::$user->id, $sub['id']); + Arsse::$db->subscriptionRemove(Arsse::$user->id, (int) $sub['id']); } $tr->commit(); } diff --git a/lib/REST/TinyTinyRSS/API.php b/lib/REST/TinyTinyRSS/API.php index 3732623..60c4e3b 100644 --- a/lib/REST/TinyTinyRSS/API.php +++ b/lib/REST/TinyTinyRSS/API.php @@ -1357,7 +1357,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler { 'score' => 0, // score is not implemented as it is not modifiable from the TTRSS API 'note' => strlen((string) $article['note']) ? $article['note'] : null, 'lang' => "", // FIXME: picoFeed should be able to retrieve this information - 'tags' => Arsse::$db->articleCategoriesGet(Arsse::$user->id, $article['id']), + 'tags' => Arsse::$db->articleCategoriesGet(Arsse::$user->id, (int) $article['id']), 'comments_count' => 0, 'comments_link' => "", 'always_display_attachments' => false, diff --git a/tests/cases/REST/TinyTinyRSS/TestAPI.php b/tests/cases/REST/TinyTinyRSS/TestAPI.php index 0a2016e..18d1d24 100644 --- a/tests/cases/REST/TinyTinyRSS/TestAPI.php +++ b/tests/cases/REST/TinyTinyRSS/TestAPI.php @@ -945,6 +945,7 @@ LONG_STRING; [['label_id' => -1042, 'caption' => ""], [$this->userId, 18, ['name' => ""]], new ExceptionInput("missing"), $this->respGood()], [['label_id' => -1042, 'caption' => " "], [$this->userId, 18, ['name' => " "]], new ExceptionInput("whitespace"), $this->respGood()], [['label_id' => -1042], [$this->userId, 18, ['name' => ""]], new ExceptionInput("missing"), $this->respGood()], + [['label_id' => -1042], [$this->userId, 18, ['name' => ""]], new ExceptionInput("typeViolation"), $this->respErr("INCORRECT_USAGE")], [['label_id' => -1, 'caption' => "Ook"], null, null, $this->respErr("INCORRECT_USAGE")], [['caption' => "Ook"], null, null, $this->respErr("INCORRECT_USAGE")], [[], null, null, $this->respErr("INCORRECT_USAGE")],