From 6124cdef7400a29aaa29ec4e78e459b513f3c551 Mon Sep 17 00:00:00 2001 From: Florent Viel Date: Tue, 16 Dec 2014 14:59:32 +0100 Subject: [PATCH 1/3] fix html fetch --- src/Fetch/Message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index e7939f2..67bb1bf 100755 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -504,7 +504,7 @@ class Message } $this->plaintextMessage .= trim($messageBody); - } else { + } elseif (strtolower($structure->subtype) === 'html') { if (isset($this->htmlMessage)) { $this->htmlMessage .= '

'; } else { From 378bfbdbe015c8a4d71c49f5b3400f6966c28b61 Mon Sep 17 00:00:00 2001 From: Florent Viel Date: Tue, 16 Dec 2014 14:59:55 +0100 Subject: [PATCH 2/3] fix message decoding --- src/Fetch/Message.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index 67bb1bf..152a4bd 100755 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -541,15 +541,18 @@ class Message $encoding = strtolower($encoding); } - switch (true) { - case $encoding === 'quoted-printable': - case $encoding === 4: - return quoted_printable_decode($data); - - case $encoding === 'base64': - case $encoding === 3: + switch ($encoding) { + case 'base64': + case 3: + case 5: + case 6: + case 7: return base64_decode($data); + case 'quoted-printable': + case 4: + return quoted_printable_decode($data); + default: return $data; } From bcdc85d5d850220ec3b92521063ac6cd94fd6046 Mon Sep 17 00:00:00 2001 From: Florent Viel Date: Tue, 16 Dec 2014 15:34:55 +0100 Subject: [PATCH 3/3] Revert "fix message decoding" This reverts commit 378bfbdbe015c8a4d71c49f5b3400f6966c28b61. --- src/Fetch/Message.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index 152a4bd..67bb1bf 100755 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -541,18 +541,15 @@ class Message $encoding = strtolower($encoding); } - switch ($encoding) { - case 'base64': - case 3: - case 5: - case 6: - case 7: - return base64_decode($data); - - case 'quoted-printable': - case 4: + switch (true) { + case $encoding === 'quoted-printable': + case $encoding === 4: return quoted_printable_decode($data); + case $encoding === 'base64': + case $encoding === 3: + return base64_decode($data); + default: return $data; }