Skip to content

Commit 9202b02

Browse files
authored
Fix 'A non well formed numeric value encountered' ErrorException (#327)
$partNumber is allowed to be a string, therefore '|' will lead to an Exception.
1 parent ef46694 commit 9202b02

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/IMAP/Message.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,11 @@ private function createBody($type, $structure, $partNumber){
690690
private function fetchPart($structure, $partNumber){
691691
$encoding = $this->getEncoding($structure);
692692

693-
$content = \imap_fetchbody($this->client->getConnection(), $this->uid, $partNumber | 1, $this->fetch_options | IMAP::FT_UID);
693+
if (!$partNumber) {
694+
$partNumber = 1;
695+
}
696+
697+
$content = \imap_fetchbody($this->client->getConnection(), $this->uid, $partNumber, $this->fetch_options | IMAP::FT_UID);
694698
$content = $this->decodeString($content, $structure->encoding);
695699

696700
// We don't need to do convertEncoding() if charset is ASCII (us-ascii):

0 commit comments

Comments
 (0)