From 5e64f26e93a4f8fefced2da421ff3bebe21fc33d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 20 Sep 2023 19:20:24 +1200 Subject: [PATCH] Fix verify verp function to cope with job_id having been deleted This allows the record to be validated based on queue_id & hash (which is still pretty insane to brute force & allows us to purge job records --- CRM/Mailing/Event/BAO/MailingEventQueue.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Mailing/Event/BAO/MailingEventQueue.php b/CRM/Mailing/Event/BAO/MailingEventQueue.php index 6b1d8b20d6..05d2cca855 100644 --- a/CRM/Mailing/Event/BAO/MailingEventQueue.php +++ b/CRM/Mailing/Event/BAO/MailingEventQueue.php @@ -56,7 +56,7 @@ class CRM_Mailing_Event_BAO_MailingEventQueue extends CRM_Mailing_Event_DAO_Mail /** * Verify that a queue event exists with the specified id/job id/hash. * - * @param int $job_id + * @param int|int $job_id * The job ID of the event to find. * @param int $queue_id * The Queue Event ID to find. @@ -66,12 +66,11 @@ class CRM_Mailing_Event_BAO_MailingEventQueue extends CRM_Mailing_Event_DAO_Mail * @return object|null * The queue event if verified, or null */ - public static function &verify($job_id, $queue_id, $hash) { + public static function verify($job_id, $queue_id, $hash) { $success = NULL; $q = new CRM_Mailing_Event_BAO_MailingEventQueue(); - if (!empty($job_id) && !empty($queue_id) && !empty($hash)) { + if ($queue_id && $hash) { $q->id = $queue_id; - $q->job_id = $job_id; $q->hash = $hash; if ($q->find(TRUE)) { $success = $q; -- 2.25.1