Last modified: 2010-05-25 13:25:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25648, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23648 - UserMailer.php function send() throws warning if $to is an array of MailAddress
UserMailer.php function send() throws warning if $to is an array of MailAddress
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.16.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-24 17:37 UTC by Dan Barrett
Modified: 2010-05-25 13:25 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Barrett 2010-05-24 17:37:56 UTC
function send() in includes/UserMailer.php has a first parameter, $to, that can be a singleton or an array. If a singleton, it must be a MailAddress object. If you pass an array of MailAddress objects, however, you get the warning:

Object of class MailAddress to string conversion in .../includes/UserMailer.php on line 115

The line is:

wfDebug( __METHOD__.': sending mail to '  . implode( ',', $to ) . "\n" ); 

This is strange. send() seems to be expecting an array of strings, or a single MailAddress, but not an array of MailAddress objects.

This is either a bug to be fixed, or extra documentation is needed about valid values for $to.
Comment 1 Chad H. 2010-05-25 13:25:55 UTC
It's the wfDebug() that's wrong, it should accept arrays of objects not strings. Fixed the wfDebug() in r66871.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links