I get this message whenever an e-mail to multiple recipients is logged:

warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/jjw/ashateam/drupal-6.20/includes/database.mysqli.inc on line 330.

To prevent this, I've modified the maillog_mail_send() function to check if $messge['to'] is an array, like this:

    $to = $messge['to'];
    if (is_array($to))
    	$to = implode(', ', $to);

later...

    $record->header_to = isset($to) ? $to : NULL;
CommentFileSizeAuthor
#2 maillog_1113580.patch908 bytesmiro_dietiker
#1 maillog.patch981 bytesjjwhitney
maillog.patch980 bytesjjwhitney

Comments

jjwhitney’s picture

StatusFileSize
new981 bytes

There's a small typo in this patch that prevents the recipient list from showing up in the mail log. Here is the corrected patch.

miro_dietiker’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Fixed
StatusFileSize
new908 bytes

Fixed with some improvements in D7 and D6.
Attached the D7 patch how it applied.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.