MyBB Community Forums
[F] portal.php links to guest user profiles [C-Michael83] - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: Archived Bug Reports (https://community.mybb.com/forum-74.html)
+------ Forum: MyBB 1.4.4 (https://community.mybb.com/forum-110.html)
+------ Thread: [F] portal.php links to guest user profiles [C-Michael83] (/thread-46540.html)



[F] portal.php links to guest user profiles [C-Michael83] - frostschutz - 03-11-2009

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).


RE: portal.php links to guest user profiles - dvb - 03-12-2009

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...


[F] portal.php links to guest user profiles - Ryan Gordon - 03-16-2009

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


RE: [F] portal.php links to guest user profiles - Chris W. B. - 03-17-2009

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.


RE: [F] portal.php links to guest user profiles - Ryan Gordon - 03-17-2009

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']);
}



RE: [F] portal.php links to guest user profiles - Chris W. B. - 03-17-2009

(03-17-2009, 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.