Prevent casting a non-existent array key before it's been coalesced in Model\GServer

- Address https://github.com/friendica/friendica/issues/13025#issuecomment-1536440077
This commit is contained in:
Hypolite Petovan 2023-05-06 23:48:32 -04:00
parent f673232e53
commit 29329f799d

View file

@ -869,7 +869,7 @@ class GServer
}
// Sanitize incoming data, see https://github.com/friendica/friendica/issues/8565
$data['subscribe'] = (bool)$data['subscribe'] ?? false;
$data['subscribe'] = (bool)($data['subscribe'] ?? false);
if (!$data['subscribe'] || empty($data['scope']) || !in_array(strtolower($data['scope']), ['all', 'tags'])) {
$data['scope'] = '';