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
Switch to threaded view of this topic 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 next message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma: 0
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);
Re: Anon User ID in maillist.php (RC3) not working [message #17019 is a reply to message #17018] Tue, 09 March 2004 18:18 Go to previous messageGo to next message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma: 0
Senior Member
BTW NNTP also is not showing up but I did not diagnose it.
Re: Anon User ID in maillist.php (RC3) not working [message #17020 is a reply to message #17019] Tue, 09 March 2004 19:37 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Fixed in CVS for both NNTP and Mailing Lists.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Sun Nov 24 01:27:19 GMT 2024

Total time taken to generate the page: 0.02561 seconds