summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-04-17 07:01:03 +0000
committeralecpl <alec@alec.pl>2008-04-17 07:01:03 +0000
commit0a97a039c4b35223ab8d23684185ae526c1bca2a (patch)
treed403afadd5a2b35df55018c85e557e200213f499
parent140d6e90638752a6d14738fcaa891fc3a7cd81fd (diff)
- Fix IMAP response in message body when message has no body (#1484964)
-rw-r--r--CHANGELOG6
-rw-r--r--program/lib/imap.inc23
2 files changed, 19 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 8f91d15f2..b7c8da54a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,11 @@
CHANGELOG RoundCube Webmail
---------------------------
-2008/04/12 (estadtherr)
+2008/04/17 (alec)
+----------
+- Fix IMAP response in message body when message has no body (#1484964)
+
+2008/04/16 (estadtherr)
----------
- Fix mail sending with new TinyMCE
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 5c15353f5..918e71a18 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -2332,17 +2332,22 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part, $mode) {
$len = strlen($line);
if ($line[$len-1] == ')') {
//one line response, get everything between first and last quotes
- $from = strpos($line, '"') + 1;
- $to = strrpos($line, '"');
- $len = $to - $from;
- if ($mode == 1) {
- $result = substr($line, $from, $len);
- } else if ($mode == 2) {
- echo substr($line, $from, $len);
+ if (substr($line, -4, 3) == 'NIL') {
+ // NIL response
+ $result = '';
+ } else {
+ $from = strpos($line, '"') + 1;
+ $to = strrpos($line, '"');
+ $len = $to - $from;
+ $result = substr($line, $from, $len);
+ }
+
+ if ($mode == 2) {
+ echo $result;
} else if ($mode == 3) {
- echo base64_decode(substr($line, $from, $len));
+ echo base64_decode($result);
}
- }else if ($line[$len-1] == '}') {
+ } else if ($line[$len-1] == '}') {
//multi-line request, find sizes of content and receive that many bytes
$from = strpos($line, '{') + 1;
$to = strrpos($line, '}');