-
-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Labels
Description
Describe the bug
Uid function argument (sequence type) of header method gets overwritten by foreach. This results, that UID-based sequence is used for messageId-based header enumeration as well.
Problematic block:
public function headers($uids, $rfc = "RFC822", $uid = false){
$result = [];
$uids = is_array($uids) ? $uids : [$uids];
foreach ($uids as $uid) {
$result[$uid] = \imap_fetchheader($this->stream, $uid, $uid ? IMAP::FT_UID : IMAP::NIL);
}
return $result;
}Possible solution changing variable name from uid to id in foreach:
public function headers($uids, $rfc = "RFC822", $uid = false){
$result = [];
$uids = is_array($uids) ? $uids : [$uids];
foreach ($uids as $id) {
$result[$id] = \imap_fetchheader($this->stream, $id, $uid ? IMAP::FT_UID : IMAP::NIL);
}
return $result;
}Used config
irrelevant
Code to Reproduce
irrelevant
Expected behavior
Foreach should not overwrite $uid function argument.
Screenshots
n/a
Desktop / Server (please complete the following information):
irrelevant
Additional context
n/a
MouMoutMan