Add NotFoundException for recipients in api_direct_messages_new()
This commit is contained in:
parent
cb7176ee70
commit
43688c04b1
|
@ -3487,14 +3487,20 @@ function api_direct_messages_new($type)
|
||||||
dbesc($_POST['screen_name'])
|
dbesc($_POST['screen_name'])
|
||||||
);
|
);
|
||||||
|
|
||||||
// Selecting the id by priority, friendica first
|
if (DBM::is_result($r)) {
|
||||||
api_best_nickname($r);
|
// Selecting the id by priority, friendica first
|
||||||
|
api_best_nickname($r);
|
||||||
|
|
||||||
$recipient = api_get_user($a, $r[0]['nurl']);
|
$recipient = api_get_user($a, $r[0]['nurl']);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$recipient = api_get_user($a, $_POST['user_id']);
|
$recipient = api_get_user($a, $_POST['user_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($recipient)) {
|
||||||
|
throw new NotFoundException('Recipient not found');
|
||||||
|
}
|
||||||
|
|
||||||
$replyto = '';
|
$replyto = '';
|
||||||
$sub = '';
|
$sub = '';
|
||||||
if (x($_REQUEST, 'replyto')) {
|
if (x($_REQUEST, 'replyto')) {
|
||||||
|
|
Loading…
Reference in a new issue