MyBB Community Forums

Full Version: [F] Error in xmlhttp.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.