Hi Ilia;
maillist.php is not working correctly when identifying anonymous authors:
if (!$emsg->from_email || !$emsg->from_name) {
$msg_post->poster_id = 0;
} else {
$msg_post->poster_id = match_user_to_post($emsg->from_email, $emsg->from_name, $mlist->mlist_opt & 64, $emsg->user_id);
}
/* for anonymous users prefix 'contact' link */
if (!$msg_post->poster_id) {
if ($frm->forum_opt & 16) {
$msg_post->body = "[b]Originally posted by:[/b] [email={(!empty($emsg->from_name) ? $emsg->from_name : '')}]{$emsg->from_email}[/email]\n\n".$msg_post->body;
} else {
$msg_post->body = "Originally posted by: ".str_replace('@', '@', $emsg->from_email)."\n\n".$msg_post->body;
}
}
$msg_post->body = apply_custom_replace($emsg->body);
if (!($mlist->mlist_opt & 16)) {
if ($frm->forum_opt & 16) {
$msg_post->body = tags_to_html($msg_post->body, 0);
} else {
$msg_post->body = nl2br($msg_post->body);
}
}
fud_wordwrap($msg_post->body);
$msg_post->subject = htmlspecialchars(apply_custom_replace($emsg->subject));
if (!strlen($msg_post->subject)) {
mlist_error_log("Blank Subject", $emsg->raw_msg);
}
The ordering of this code causes the anon user info to be stomped out by the apply_custom_replace function. In addition, the elements of the anon post is out of order:
msg_post->body = "[b]Originally posted by:[/b] [email={(!empty($emsg->from_name) ? $emsg->from_name : '')}]{$emsg->from_email}[/email]\n\n".$msg_post->body;
This causes the email to be the name and the name to be the email.
Here's my fixed version:
$msg_post->body = apply_custom_replace($emsg->body);
/* for anonymous users prefix 'contact' link */
if (!$msg_post->poster_id) {
if ($frm->forum_opt & 16) {
$msg_post->body = "[b]Originally posted by:[/b] [email={$emsg->from_email}]" . (!empty($emsg->from_name) ? $emsg->from_name : $emsg->from_email) . "[/email]\n\n" . $msg_post->body;
} else {
$msg_post->body = "Originally posted by: ".str_replace('@', '@', $emsg->from_email)."\n\n".$msg_post->body;
}
}
if (!($mlist->mlist_opt & 16)) {
if ($frm->forum_opt & 16) {
$msg_post->body = tags_to_html($msg_post->body, 0);
} else {
$msg_post->body = nl2br($msg_post->body);
}
}
fud_wordwrap($msg_post->body);