Skip to content

Commit

Permalink
Merge pull request #48 from lcbrq/hotfix/47-imap
Browse files Browse the repository at this point in the history
Fixes #47 undefined imap_utf8
  • Loading branch information
Derrick Heesbeen authored Apr 1, 2020
2 parents 93c2755 + 2a9a3d7 commit 447179f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Model/Emailcatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function saveMessage($message)
$sender = 'could not retrieve from address';
}

$subject = imap_utf8($message->getSubject());
$subject = $this->imapUtf8($message->getSubject());
$this->setBody($body);
$this->setSubject($subject);
$this->setRecipient($recipient);
Expand Down Expand Up @@ -123,4 +123,17 @@ public function getEmailAddressesFromObject($addresses, $asString = true)

return $emailAddresses;
}

/**
* @todo imap_utf8 replacement
* @param string $string
* @return string $string
*/
public function imapUtf8($string)
{
if (function_exists('imap_utf8')) {
$string = imap_utf8($string);
}
return $string;
}
}

0 comments on commit 447179f

Please sign in to comment.