From d721feb1e43389e4e05ed381b971dd040c60624c Mon Sep 17 00:00:00 2001 From: maxpozdeev Date: Fri, 12 Aug 2022 12:10:55 +0300 Subject: [PATCH] fix issue with null coalescing priority --- src/export.php | 2 +- src/feed.php | 2 +- src/includes/api/ListsController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/export.php b/src/export.php index 0d7d83e..8a3b9bf 100644 --- a/src/export.php +++ b/src/export.php @@ -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."); diff --git a/src/feed.php b/src/feed.php index 356af99..2f9d896 100644 --- a/src/feed.php +++ b/src/feed.php @@ -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!
List is not published."); diff --git a/src/includes/api/ListsController.php b/src/includes/api/ListsController.php index 52f4ab3..3aac2b1 100644 --- a/src/includes/api/ListsController.php +++ b/src/includes/api/ListsController.php @@ -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(