MyBB Community Forums

Full Version: Cannot send PM's to Self ... By Tikitiki ... Not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I've just downloaded and activated the Cannot send PM's to Self plug in and I've tested with another temp user I've created for testing purposes I've found that it is not working and the temp user was able to send a PM to itself.
What could be wrong?
Thanks
	if(strcasecmp($mybb->input['to'], $mybb->user['username']) == 0) 
	{
		error("The administrator has selected that you may not send Private Messages to yourself.");
	}

$mybb->input['to'] contains an annoying comma in it since you now can send multiple PM's at one time,so the string comparison returns false and thats why you can send PM's to yourself =P
I suggest changing it into
	if(strpos($mybb->input['to'], $mybb->user['username']) !== false) 
	{
		error("The administrator has selected that you may not send Private Messages to yourself.");
	}
Or wait for Tikitiki; maybe he has another solution;
(2008-08-08, 02:41 PM)LeX- Wrote: [ -> ]
	if(strcasecmp($mybb->input['to'], $mybb->user['username']) == 0) 
	{
		error("The administrator has selected that you may not send Private Messages to yourself.");
	}

$mybb->input['to'] contains an annoying comma in it since you now can send multiple PM's at one time,so the string comparison returns false and thats why you can send PM's to yourself =P
I suggest changing it into
	if(strpos($mybb->input['to'], $mybb->user['username']) !== false) 
	{
		error("The administrator has selected that you may not send Private Messages to yourself.");
	}
Or wait for Tikitiki; maybe he has another solution;

Thanks a lot Lex ... no need to wait because you did solved Wink
Thanks