MyBB Community Forums
[F] Error in xmlhttp.php - 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.1 (https://community.mybb.com/forum-93.html)
+------ Thread: [F] Error in xmlhttp.php (/thread-37206.html)



[F] Error in xmlhttp.php - Michael S. - 2008-09-03

In the file xmlhttp.php you can find this code:
while($buddy = $db->fetch_array($query))
{
    $buddy_name = format_name($buddy['username'], $buddy['usergroup'], $buddy['displaygroup']);
    $profile_link = build_profile_link($buddy_name, $buddy['uid'], '_blank');
    if($buddy['lastactive'] > $timecut && ($buddy['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $buddy['lastvisit'] != $buddy['lastactive'])
    {
        eval("\$online[] = \"".$templates->get("xmlhttp_buddyselect_online")."\";");
    }
    else
    {
        eval("\$offline[] = \"".$templates->get("xmlhttp_buddyselect_offline")."\";");
    }
}
$online = implode("", $online);
$offline = implode("", $offline);
If the array $online or $offline is empty you get an error:
Quote:<error>
<dateline>1220365626</dateline>
<script>xmlhttp.php</script>
<line>690</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed</message>
</error>
There should be a check if the arrays contain elements.


[F] [B] Error in xmlhttp.php - Ryan Gordon - 2008-09-03

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.