FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Anon User ID in maillist.php (RC3) not working
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Anon User ID in maillist.php (RC3) not working [message #17018] Tue, 09 March 2004 18:17 Go to previous message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma:
Senior Member
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);
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: German umlauts in email notification subjects
Next Topic: Problems with notification email links in 2.6.0
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 17:27:55 GMT 2024

Total time taken to generate the page: 0.03943 seconds