]> git.mxchange.org Git - friendica.git/commitdiff
Prevent casting a non-existent array key before it's been coalesced in Model\GServer
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 7 May 2023 03:48:32 +0000 (23:48 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 7 May 2023 03:48:32 +0000 (23:48 -0400)
- Address https://github.com/friendica/friendica/issues/13025#issuecomment-1536440077

src/Model/GServer.php

index 11d3227e8ad06ecbfb77521373d2c120e6ac45af..758ff0f13538da8020e524da74d6a3b02d45f2d5 100644 (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'] = '';