Skip to content

Commit

Permalink
Fix 'A non well formed numeric value encountered' ErrorException (#327)
Browse files Browse the repository at this point in the history
$partNumber is allowed to be a string, therefore '|' will lead to an
Exception.
  • Loading branch information
Hokan22 authored Sep 7, 2020
1 parent ef46694 commit 9202b02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/IMAP/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,11 @@ private function createBody($type, $structure, $partNumber){
private function fetchPart($structure, $partNumber){
$encoding = $this->getEncoding($structure);

$content = \imap_fetchbody($this->client->getConnection(), $this->uid, $partNumber | 1, $this->fetch_options | IMAP::FT_UID);
if (!$partNumber) {
$partNumber = 1;
}

$content = \imap_fetchbody($this->client->getConnection(), $this->uid, $partNumber, $this->fetch_options | IMAP::FT_UID);
$content = $this->decodeString($content, $structure->encoding);

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

0 comments on commit 9202b02

Please sign in to comment.