1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Fix a MetaMTA array_combine() warning

Summary:
Fixes T2290. Older versions of PHP (prior to PHP 5.4) raised a warning if you tried to combine empty arrays. (Newer versions don't, which is why I missed this in testing, although I may also not have tried sending empty mail.)

If mail has no recipients, we reach this with an empty array. Just skip the function body and return immediately, the result is empty array.

(You can get mail with no recipients in various valid ways, currently by, e.g., commenting on a Macro with no subscribers.)

Test Plan: Sent mail with zero, nonzero recipients. Received the nonzero recipient mail. Verified on php.net that this is a version issue.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2290

Differential Revision: https://secure.phabricator.com/D4360
This commit is contained in:
epriestley 2013-01-08 10:39:49 -08:00
parent df2c811a54
commit 7752717125

View file

@ -803,6 +803,10 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
* @task recipients
*/
private function resolveRecipients(array $phids) {
if (!$phids) {
return array();
}
$phids = array_combine($phids, $phids);