mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16: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:
parent
df2c811a54
commit
7752717125
1 changed files with 4 additions and 0 deletions
|
@ -803,6 +803,10 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
* @task recipients
|
* @task recipients
|
||||||
*/
|
*/
|
||||||
private function resolveRecipients(array $phids) {
|
private function resolveRecipients(array $phids) {
|
||||||
|
if (!$phids) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
$phids = array_combine($phids, $phids);
|
$phids = array_combine($phids, $phids);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue