Skip to content

Commit 8a52237

Browse files
Fix problem with illegal offset error. (#226)
* Fix problem with illegal offset error. * Switched to more precise comparison method (type detection).
1 parent 64ef8f0 commit 8a52237

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Connection/Protocols/ImapProtocol.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,12 @@ public function fetch($items, $from, $to = null, $uid = IMAP::ST_UID) {
600600
} else if ($tokens[2][0] == 'UID') {
601601
$uidKey = 1;
602602
} else {
603-
$uidKey = array_search('UID', $tokens[2]) + 1;
603+
$found = array_search('UID', $tokens[2]);
604+
if ($found === false || $found === -1) {
605+
continue;
606+
}
607+
608+
$uidKey = $found + 1;
604609
}
605610
}
606611

0 commit comments

Comments
 (0)