Adamw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/61493
Change subject: array_walk is sad about array cast. It breaks
pass-by-reference.
......................................................................
array_walk is sad about array cast. It breaks pass-by-reference.
Change-Id: Iac68ec47c398a6c2b82115fa45b2204c74a408f5
---
M SmashPig/Core/MailHandler.php
1 file changed, 10 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/PaymentsListeners
refs/changes/93/61493/1
diff --git a/SmashPig/Core/MailHandler.php b/SmashPig/Core/MailHandler.php
index 97829c6..4362999 100644
--- a/SmashPig/Core/MailHandler.php
+++ b/SmashPig/Core/MailHandler.php
@@ -6,6 +6,7 @@
* Abstraction on top of whatever email client we're actually using. For the
moment that's
* PHPMailer on top of sendmail. The PHPMailer library must be in the include
path. Use the
* configuration node 'include-paths' to do this.
+ * FIXME: should be more explicit, phpmailer-include-path or something
*/
class MailHandler {
@@ -67,11 +68,16 @@
$mailer = static::mailbaseFactory();
try {
- array_walk( (array)$to, function ( $value, $key ) use (
$mailer ) { $mailer->AddAddress( $value ); } );
- array_walk( (array)$cc, function ( $value, $key ) use (
$mailer ) { $mailer->AddCC( $value ); } );
- array_walk( (array)$bcc, function ( $value, $key ) use
( $mailer ) { $mailer->AddBCC( $value ); } );
+ $to = (array)$to;
+ $cc = (array)$cc;
+ $bcc = (array)$bcc;
+ $archives = (array)$config->val(
'email/archive-addresses' );
+
+ array_walk( $to, function ( $value, $key ) use (
$mailer ) { $mailer->AddAddress( $value ); } );
+ array_walk( $cc, function ( $value, $key ) use (
$mailer ) { $mailer->AddCC( $value ); } );
+ array_walk( $bcc, function ( $value, $key ) use (
$mailer ) { $mailer->AddBCC( $value ); } );
array_walk(
- (array)$config->val( 'email/archive-addresses'
),
+ $archives,
function ( $value, $key ) use ( $mailer ) {
$mailer->AddBCC( $value ); }
);
--
To view, visit https://gerrit.wikimedia.org/r/61493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac68ec47c398a6c2b82115fa45b2204c74a408f5
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/PaymentsListeners
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits