From cab0aca17c22e0bdeabbc642fde2cca79ea94d7f Mon Sep 17 00:00:00 2001 From: Richard Shank Date: Wed, 7 May 2014 14:26:59 -0700 Subject: [PATCH] fix the behavior in Message:decode --- src/Fetch/Message.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index 3644c91..cab27f8 100644 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -481,16 +481,17 @@ class Message */ public static function decode($data, $encoding) { - if (!is_numeric($encoding)) + if (!is_numeric($encoding)) { $encoding = strtolower($encoding); + } - switch ($encoding) { - case 'quoted-printable': - case 4: + switch (true) { + case $encoding === 'quoted-printable': + case $encoding === 4: return quoted_printable_decode($data); - case 'base64': - case 3: + case $encoding === 'base64': + case $encoding === 3: return base64_decode($data); default: