When using HTML email as the welcome message, if the email code contains the text 'body' this is replaced with an entire copy of the email body.
<tbody>
tagsThe issue is caused by line #866 of user_import.module:
$body = (empty($params['body'])) ? _user_mail_text('register_admin_created_body', $message['language'], $params) : strtr($params['body'], $params)
;
The $params array contains a parameter called 'body' that the strtr() function replaces in the body html. Every occurance of the text 'body' in the source then gets swapped with the original html source code.
I propose building another parameter array that only contains the replaceable parameters that all begin with "!". Patch file attached.
Proposed code inserted at line #865 as follows:
$replaceableParams = array();
foreach ($params as $key => $value) {
if (!is_null($value) && $value != "" && substr($key,0,1) == "!") {
$replaceableParams[$key] = $value;
}
}
Line #866 change from:
$body = (empty($params['body'])) ? _user_mail_text('register_admin_created_body', $message['language'], $params) : strtr($params['body'], $params);
to:
$body = (empty($params['body'])) ? _user_mail_text('register_admin_created_body', $message['language'], $params) : strtr($params['body'], $replaceableParams);
None
None
None
Needs review
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.