From 06b4f164f5bb26162fa948797b4cc79e09e27fe1 Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 14 Mar 2025 08:21:08 +0000 Subject: [PATCH] cast db stmt object to array --- notifyall/notifyall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifyall/notifyall.php b/notifyall/notifyall.php index 387fa1ab..f814c4f5 100644 --- a/notifyall/notifyall.php +++ b/notifyall/notifyall.php @@ -50,14 +50,14 @@ function notifyall_post() $recipients = DBA::p("SELECT DISTINCT `email` FROM `user`" . DBA::buildCondition($condition), $condition); - if (! $recipients || !is_iterable($recipients)) { + if (! $recipients) { DI::sysmsg()->addNotice(DI::l10n()->t('No recipients found.')); return; } $notifyEmail = new NotifyAllEmail(DI::l10n(), DI::config(), DI::baseUrl(), $text); - foreach ($recipients as $recipient) { + foreach (DBA::toArray($recipients) as $recipient) { DI::emailer()->send($notifyEmail->withRecipient($recipient['email'])); }