Skip to content
Snippets Groups Projects
Commit 5e4125a3 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix crash processing email on PHP 5.3

parent 1727c658
No related branches found
No related tags found
No related merge requests found
...@@ -209,6 +209,7 @@ class Mailer { ...@@ -209,6 +209,7 @@ class Mailer {
if (count($parts) < 2) if (count($parts) < 2)
return $rv; return $rv;
$self = get_called_class();
$decoders = array( $decoders = array(
'A' => function($id, $tag) use ($sig) { 'A' => function($id, $tag) use ($sig) {
// Old format was VA-B-C-D@sig, where C was the packed tag and D // Old format was VA-B-C-D@sig, where C was the packed tag and D
...@@ -221,11 +222,11 @@ class Mailer { ...@@ -221,11 +222,11 @@ class Mailer {
} }
return false; return false;
}, },
'B' => function($id, $tag) { 'B' => function($id, $tag) use ($self) {
$format = 'Vuid/VentryId/VthreadId/auserClass/a*sig'; $format = 'Vuid/VentryId/VthreadId/auserClass/a*sig';
if ($tag && ($tag = base64_decode($tag))) { if ($tag && ($tag = base64_decode($tag))) {
$info = unpack($format, $tag); $info = unpack($format, $tag);
$sysid = static::getSystemMessageIdCode(); $sysid = $self::getSystemMessageIdCode();
$shorttag = substr($tag, 0, 13); $shorttag = substr($tag, 0, 13);
$chksig = substr(hash_hmac('sha1', $shorttag.$id.$sysid, $chksig = substr(hash_hmac('sha1', $shorttag.$id.$sysid,
SECRET_SALT, true), -5); SECRET_SALT, true), -5);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment