Skip to content

Commit c06f6c7

Browse files
committed
better reply to address handling
1 parent 880802a commit c06f6c7

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

modules/core/message_functions.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,10 @@ function reply_to_address($headers, $type, $excluded) {
102102
if ($type == 'forward') {
103103
return $msg_to;
104104
}
105-
if (array_key_exists('reply-to', $headers)) {
106-
$msg_to = $headers['reply-to'];
107-
}
108-
elseif (array_key_exists('from', $headers)) {
109-
$msg_to = $headers['from'];
110-
}
111-
elseif (array_key_exists('sender', $headers)) {
112-
$msg_to = $headers['sender'];
113-
}
114-
elseif (array_key_exists('return-path', $headers)) {
115-
$msg_to = $headers['return-path'];
116-
}
117-
if ($msg_to) {
118-
$msg_to = format_reply_address($msg_to, array());
105+
foreach (array('reply-to', 'from', 'sender', 'return-path') as $fld) {
106+
if (array_key_exists($fld, $headers) && $msg_to = format_reply_address($headers[$fld])) {
107+
break;
108+
}
119109
}
120110
if ($type == 'reply_all') {
121111
if (array_key_exists('cc', $headers)) {

0 commit comments

Comments
 (0)