Minor improvements (#231)

This commit is contained in:
Roman Kelesidis 2023-08-27 23:37:03 +07:00 committed by GitHub
parent de00055c6a
commit 0a1a036eff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class torrent
continue;
}
// Exclude padding files
if (($f['attr'] ?? null) === 'p')
if ((isset($f['attr']) ? $f['attr'] : null) === 'p')
{
continue;
}

View File

@ -297,7 +297,7 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
// Check if torrent contains info_hash v2
$bt_v2 = false;
if (($info['meta version'] ?? null) == 2 && is_array($info['file tree'] ?? null))
if ((isset($info['meta version']) ? $info['meta version'] : null) == 2 && is_array(isset($info['file tree']) ? $info['file tree'] : null))
{
$bt_v2 = true;
}
@ -338,7 +338,7 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
foreach ($info['files'] as $fn => $f)
{
// Exclude padding files
if (($f['attr'] ?? null) !== 'p')
if ((isset($f['attr']) ? $f['attr'] : null) !== 'p')
{
$totallen += (float) $f['length'];
}