From 894c1f6478c59f978bcd08df6499cb6730690008 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Thu, 6 Aug 2015 11:28:50 -0500 Subject: [PATCH] mailer: Fix warning when parsing some message-ids --- include/class.mailer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/class.mailer.php b/include/class.mailer.php index 5cd4dfc4b..49b15ec28 100644 --- a/include/class.mailer.php +++ b/include/class.mailer.php @@ -225,7 +225,8 @@ class Mailer { 'B' => function($id, $tag) use ($self) { $format = 'Vuid/VentryId/VthreadId/auserClass/a*sig'; if ($tag && ($tag = base64_decode($tag))) { - $info = unpack($format, $tag); + if (!($info = @unpack($format, $tag)) || !isset($info['sig'])) + return false; $sysid = $self::getSystemMessageIdCode(); $shorttag = substr($tag, 0, 13); $chksig = substr(hash_hmac('sha1', $shorttag.$id.$sysid, -- GitLab