fix the behavior in Message:decode

This commit is contained in:
Richard Shank 2014-05-07 14:26:59 -07:00
parent 52930d5d75
commit cab0aca17c

View File

@ -481,16 +481,17 @@ class Message
*/ */
public static function decode($data, $encoding) public static function decode($data, $encoding)
{ {
if (!is_numeric($encoding)) if (!is_numeric($encoding)) {
$encoding = strtolower($encoding); $encoding = strtolower($encoding);
}
switch ($encoding) { switch (true) {
case 'quoted-printable': case $encoding === 'quoted-printable':
case 4: case $encoding === 4:
return quoted_printable_decode($data); return quoted_printable_decode($data);
case 'base64': case $encoding === 'base64':
case 3: case $encoding === 3:
return base64_decode($data); return base64_decode($data);
default: default: