2015-02-17, 10:57 PM
Hi,
inc/datahandlers/pm.php
That is wrong. $user['ignorelist'] should be checked if it's empty before exploding it, otherwise an array will be created:
At first glance there are no problems. Now look at send_pm in functions.php. $fromid can be set to 0 / empty, therefore in_array($pm['fromid'], $ignorelist) is true even though the ignorelist is empty.
Fix:
The same thing should be done to the buddy list (a few lines below).
Regards,
Diogo
inc/datahandlers/pm.php
$ignorelist = explode(",", $user['ignorelist']);
if(!empty($ignorelist) && in_array($pm['fromid'], $ignorelist))
{
$this->set_error("recipient_is_ignoring", array($user['username']));
}
That is wrong. $user['ignorelist'] should be checked if it's empty before exploding it, otherwise an array will be created:
array (
[0] =>
)
At first glance there are no problems. Now look at send_pm in functions.php. $fromid can be set to 0 / empty, therefore in_array($pm['fromid'], $ignorelist) is true even though the ignorelist is empty.
Fix:
if($user['ignorelist'] != '')
{
$ignorelist = explode(",", $user['ignorelist']);
if(!empty($ignorelist) && in_array($pm['fromid'], $ignorelist))
{
$this->set_error("recipient_is_ignoring", array($user['username']));
}
}
The same thing should be done to the buddy list (a few lines below).
Regards,
Diogo