send a 403 for followers/following if permission is denied AND there is no observer.

This commit is contained in:
Mike Macgirvin 2022-12-05 05:46:33 +11:00
parent 6e52be89c3
commit 30426ffdf7
2 changed files with 13 additions and 4 deletions

View file

@ -35,7 +35,12 @@ class Followers extends Controller
$sqlExtra = '';
if (!perm_is_allowed($channel['channel_id'], $observer_hash, 'view_contacts')) {
$sqlExtra = ($observer_hash) ? " AND xchan_hash = '" . dbesc($observer_hash) . "' " : '';
if ($observer_hash) {
$sqlExtra = " AND xchan_hash = '" . dbesc($observer_hash) . "' ";
}
else {
http_status_exit(403, 'Permission denied');
}
}
$t = q(

View file

@ -34,9 +34,13 @@ class Following extends Controller
$observer_hash = get_observer_hash();
$sqlExtra = '';
if (!perm_is_allowed($channel['channel_id'], $observer_hash, 'view_contacts')) {
$sqlExtra = ($observer_hash) ? " AND xchan_hash = '" . dbesc($observer_hash) . "' " : '';
if ($observer_hash) {
$sqlExtra = " AND xchan_hash = '" . dbesc($observer_hash) . "' ";
}
else {
http_status_exit(403, 'Permission denied');
}
}
$t = q(