Skip to content

Commit 00b2592

Browse files
authored
Avoid TypeError due to $lastError being boolean/false instead of a string (strict types) (#608)
1 parent 60b3f34 commit 00b2592

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpImap/Imap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ public static function open(
706706
if (!$result) {
707707
$lastError = \imap_last_error();
708708

709-
if ('' !== \trim($lastError)) {
709+
if ((\is_string($lastError)) && ('' !== \trim($lastError))) {
710710
throw new UnexpectedValueException('IMAP error:'.$lastError);
711711
}
712712

0 commit comments

Comments
 (0)