| | |
| | | } |
| | | // fetch specified header for all messages and sort |
| | | else if ($msg_index = $this->conn->fetchHeaderIndex($mailbox, "1:*", |
| | | $this->sort_field, $this->skip_deleted, true) |
| | | $this->sort_field, $this->skip_deleted) |
| | | ) { |
| | | asort($msg_index); // ASC |
| | | $msg_index = array_keys($msg_index); |
| | |
| | | $msg_index = array_slice($msg_index, ($this->sort_order == 'DESC' ? 0 : -$slice), $slice); |
| | | |
| | | // fetch reqested headers from server |
| | | $a_msg_headers = $this->fetch_headers($mailbox, $msg_index, true); |
| | | $a_msg_headers = $this->fetch_headers($mailbox, $msg_index); |
| | | } |
| | | |
| | | // return empty array if no messages found |
| | |
| | | return true; |
| | | } |
| | | |
| | | // Remove NULL characters (#1486189) |
| | | $body = str_replace("\x00", '', $body); |
| | | |
| | | // convert charset (if text or message part) |
| | | if ($body && !$skip_charset_conv && |
| | | preg_match('/^(text|message)$/', $o_part->ctype_primary) |
| | | ) { |
| | | if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') { |
| | | $o_part->charset = $this->default_charset; |
| | | if ($body && preg_match('/^(text|message)$/', $o_part->ctype_primary)) { |
| | | // Remove NULL characters (#1486189) |
| | | $body = str_replace("\x00", '', $body); |
| | | |
| | | if (!$skip_charset_conv) { |
| | | if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') { |
| | | $o_part->charset = $this->default_charset; |
| | | } |
| | | $body = rcube_charset_convert($body, $o_part->charset); |
| | | } |
| | | $body = rcube_charset_convert($body, $o_part->charset); |
| | | } |
| | | |
| | | return $body; |