Expression can be replaced by '??' version (#998)

This commit is contained in:
Roman Kelesidis 2023-10-27 14:36:07 +07:00 committed by GitHub
commit abf1c86db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -330,7 +330,7 @@ class Torrent
if ($bb_cfg['bt_check_announce_url']) { if ($bb_cfg['bt_check_announce_url']) {
include INC_DIR . '/torrent_announce_urls.php'; include INC_DIR . '/torrent_announce_urls.php';
$ann = isset($tor['announce']) ? $tor['announce'] : ''; $ann = $tor['announce'] ?? '';
$announce_urls['main_url'] = $bb_cfg['bt_announce_url']; $announce_urls['main_url'] = $bb_cfg['bt_announce_url'];
if (!$ann || !\in_array($ann, $announce_urls)) { if (!$ann || !\in_array($ann, $announce_urls)) {
@ -339,7 +339,7 @@ class Torrent
} }
} }
$info = isset($tor['info']) ? $tor['info'] : []; $info = $tor['info'] ?? [];
if (!isset($info['name'], $info['piece length'])) { if (!isset($info['name'], $info['piece length'])) {
self::torrent_error_exit($lang['TORFILE_INVALID']); self::torrent_error_exit($lang['TORFILE_INVALID']);