From 1209b90385dc87b28e7b12e40f5827a87ec9c339 Mon Sep 17 00:00:00 2001 From: Torben Dannhauer Date: Wed, 8 Jul 2026 21:23:16 +0200 Subject: [PATCH] fix(imp): return IMP_Mailbox objects from Vtrash mboxes IMP_Search_Vfolder_Vtrash::__get('mboxes') returned raw mailbox name strings, but IMP_Search_Query consumers expect IMP_Mailbox objects (e.g. the 'query' getter reads $mbox->container and 'querytext' reads $val->display). Under PHP 8 this triggered repeated warnings: Attempt to read property "container" on string (lib/Search/Query.php line 270) Wrap the result in IMP_Mailbox::get(), matching IMP_Search_Vfolder_Vinbox and the base-class contract. This also fixes a latent bug in IMP_Mailbox::expunge(), whose process list is documented to contain IMP_Mailbox objects. --- lib/Search/Vfolder/Vtrash.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Search/Vfolder/Vtrash.php b/lib/Search/Vfolder/Vtrash.php index c013868b4..d223d8bde 100644 --- a/lib/Search/Vfolder/Vtrash.php +++ b/lib/Search/Vfolder/Vtrash.php @@ -64,7 +64,9 @@ public function __get($name) $iterator::NONIMAP, ]); - return array_map('strval', iterator_to_array($iterator, false)); + return IMP_Mailbox::get( + array_map('strval', iterator_to_array($iterator, false)) + ); } return parent::__get($name);