MyBB Community Forums

Full Version: PM Verification Incorrect (ignore list)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

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
Confirmed. !empty() checks are redundant in the fix though, they don't do anything - should be removed.

Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/1845

Thanks for contributing to MyBB!

Regards,
The MyBB Group
Yeah, you're right Smile