fix issue with null coalescing priority

This commit is contained in:
maxpozdeev 2022-08-12 12:10:55 +03:00
parent 5453f36c01
commit d721feb1e4
3 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@ $db = DBConnection::instance();
$listData = $db->sqa("SELECT * FROM {$db->prefix}lists WHERE id=$listId");
if ( $listData && !is_logged() && !$listData['published'] ) {
$extra = json_decode($listData['extra'] ?? '', true, 10, JSON_INVALID_UTF8_SUBSTITUTE);
$feedKey = (string)$extra['feedKey'] ?? '';
$feedKey = (string) ($extra['feedKey'] ?? '');
$inFeedKey = trim(_get('key'));
if ($feedKey == '' || $feedKey != $inFeedKey) {
die("Access denied.");

View file

@ -17,7 +17,7 @@ $db = DBConnection::instance();
$listData = $db->sqa("SELECT * FROM {$db->prefix}lists WHERE id=$listId");
if ( $listData && need_auth() && !$listData['published'] ) {
$extra = json_decode($listData['extra'] ?? '', true, 10, JSON_INVALID_UTF8_SUBSTITUTE);
$feedKey = (string)$extra['feedKey'] ?? '';
$feedKey = (string) ($extra['feedKey'] ?? '');
$inFeedKey = trim(_get('key'));
if ($feedKey == '' || $feedKey != $inFeedKey) {
die("Access denied!<br> List is not published.");

View file

@ -189,7 +189,7 @@ class ListsController extends ApiController {
error_log("Failed to decodes JSON data of list extra listId=". (int)$row['id'] . ": " . json_last_error_msg());
$extra = [];
}
$feedKey = (string)$extra['feedKey'] ?? '';
$feedKey = (string) ($extra['feedKey'] ?? '');
}
return array(