From 5ca9e2808caa0b3e55e8ff5980d518caa7e067d2 Mon Sep 17 00:00:00 2001 From: celestora Date: Thu, 6 Jul 2023 11:47:53 +0300 Subject: [PATCH] Fix premature iterator closure error in Wall.getMyNotes --- ServiceAPI/Wall.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ServiceAPI/Wall.php b/ServiceAPI/Wall.php index 16358e93..5677f7ba 100644 --- a/ServiceAPI/Wall.php +++ b/ServiceAPI/Wall.php @@ -76,10 +76,11 @@ class Wall implements Handler function getMyNotes(callable $resolve, callable $reject) { - $myNotes = $this->notes->getUserNotes($this->user, 1, $this->notes->getUserNotesCount($this->user)); + $count = $this->notes->getUserNotesCount($this->user); + $myNotes = $this->notes->getUserNotes($this->user, 1, $count); $arr = [ - "count" => sizeof($myNotes), + "count" => $count, "closed" => $this->user->getPrivacySetting("notes.read"), "items" => [], ];