MyBB Community Forums

Full Version: [F] portal.php links to guest user profiles [C-Michael83]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If a posting / thread listed on portal.php was written by a guest, the guest name is still a link to the profile page member.php?action=profile&uid=0

Steps to reproduce:
Configure MyBB to allow posting for guests, write a thread as a guest, make that thread show up on the portal page (in the main column).
Well, we don't expect guests to publish announcements... Toungue

But yeah seems like a bug

----

In the latest thread on the side, links of last poster won't link to profiles of users because of this code:
		// Don't link to guest's profiles (they have no profile).
		if($thread['lastposteruid'] == 0)
		{
			$lastposterlink = $thread['lastposter'];
		}
		else
		{
			$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
		}
and the template use just '{$lastposterlink}', but in the case of the announcements (where the bug occur), we don't check if it's a guest and the template uses '<a href="{$mybb->settings['bburl']}/{$announcement['profilelink']}">{$announcement['username']}</a>'.
Should be the same method...
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
This fix seems to have caused the username not to display at all now, it now ends up like the following:

Posted by: - Today 12:45 AM - No Replies 

Tested on the latest trunk as of 17-03-09 - 3.00PM GMT.
Sorry. Try this (internal code only):

Find:
if($announcement['uid'] == 0)
{
	$profilelink = htmlspecialchars_uni($announcement['username']);
}

replace with

if($announcement['uid'] == 0)
{
	$profilelink = htmlspecialchars_uni($announcement['threadusername']);
}
(2009-03-17, 06:41 PM)Ryan Gordon Wrote: [ -> ]Sorry. Try this (internal code only):

Find:
if($announcement['uid'] == 0)
{
	$profilelink = htmlspecialchars_uni($announcement['username']);
}

replace with

if($announcement['uid'] == 0)
{
	$profilelink = htmlspecialchars_uni($announcement['threadusername']);
}

That seems to have fixed it Smile.