From af9dbd54b30ce162a401f77f571c65bd9895d0db Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 31 May 2013 11:37:19 +0200 Subject: Fix PHP warning when responding to a message with many Return-Path headers (#1489136) --- program/steps/mail/func.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'program/steps/mail/func.inc') diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index ab4b41155..1a687f508 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1786,9 +1786,12 @@ function rcmail_identity_select($MESSAGE, $identities = null, $compose_mode = 'r // Try Return-Path if ($from_idx === null && ($return_path = $MESSAGE->headers->others['return-path'])) { foreach ($identities as $idx => $ident) { - if (strpos($return_path, str_replace('@', '=', $ident['email_ascii']).'@') !== false) { - $from_idx = $idx; - break; + $ident = str_replace('@', '=', $ident['email_ascii']) . '@'; + foreach ((array)$return_path as $path) { + if (strpos($path, $ident) !== false) { + $from_idx = $idx; + break 2; + } } } } -- cgit v1.2.3