private function send_message()
{
global $userdata, $locale, $defender;
$inputData = array();
if (iADMIN && isset($_POST['chk_sendtoall'])) {
$inputData += array("to_group" => isset($_POST['msg_group_send']) ? form_sanitizer($_POST['msg_group_send'], 0, 'msg_group_send') : 0);
} else {
$inputData += array("to" => form_sanitizer($_POST['msg_send'], 0, 'msg_send'));
}
$inputData += array("from" => $userdata['user_id'], "subject" => form_sanitizer($_POST['subject'], '', 'subject'), "message" => form_sanitizer($_POST['message'], '', 'message'), "smileys" => isset($_POST['chk_disablesmileys']) || preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['message']) ? "n" : "y", "to_group" => 0);
if ($defender::safe()) {
if (iADMIN && isset($_POST['chk_sendtoall']) && $inputData['to_group']) {
self::send_pm($inputData['to_group'], $inputData['from'], $inputData['subject'], $inputData['message'], $inputData['smileys'], TRUE);
} else {
self::send_pm($inputData['to'], $inputData['from'], $inputData['subject'], $inputData['message'], $inputData['smileys'], FALSE);
}
if (\defender::safe()) {
addNotice("success", $locale['491']);
redirect(BASEDIR . "messages.php");
}
}
}