Fixed void function result used (#1170)

This commit is contained in:
Roman Kelesidis 2023-11-26 10:30:23 +03:00 committed by GitHub
commit f1fa98deec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -11,6 +11,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
// Start session management
$user->session_start();
if ($bb_cfg['bt_disable_dht'] && IS_GUEST) {

View file

@ -394,7 +394,11 @@ class Torrent
foreach ($info['files'] as $fn => $f) {
// Exclude padding files
if (($f['attr'] ?? null) !== 'p') {
$totallen += (isset($f['length']) && is_numeric($f['length'])) ? $f['length'] : self::torrent_error_exit($lang['TORFILE_INVALID']);
if (isset($f['length']) && is_numeric($f['length'])) {
$totallen += $f['length'];
} else {
self::torrent_error_exit($lang['TORFILE_INVALID']);
}
}
}
$totallen = (float)$totallen;
@ -407,7 +411,11 @@ class Torrent
if (!isset($value[''])) {
$size += $fileTreeSize($value);
} else {
$size += (isset($value['']['length']) && is_numeric($value['']['length'])) ? $value['']['length'] : self::torrent_error_exit($lang['TORFILE_INVALID']);
if (isset($value['']['length']) && is_numeric($value['']['length'])) {
$size += $value['']['length'];
} else {
self::torrent_error_exit($lang['TORFILE_INVALID']);
}
}
}