mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Fixed void function result used (#1170)
This commit is contained in:
parent
198ad9f79f
commit
f1fa98deec
2 changed files with 12 additions and 3 deletions
|
@ -11,6 +11,7 @@ if (!defined('BB_ROOT')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start session management
|
||||||
$user->session_start();
|
$user->session_start();
|
||||||
|
|
||||||
if ($bb_cfg['bt_disable_dht'] && IS_GUEST) {
|
if ($bb_cfg['bt_disable_dht'] && IS_GUEST) {
|
||||||
|
|
|
@ -394,7 +394,11 @@ class Torrent
|
||||||
foreach ($info['files'] as $fn => $f) {
|
foreach ($info['files'] as $fn => $f) {
|
||||||
// Exclude padding files
|
// Exclude padding files
|
||||||
if (($f['attr'] ?? null) !== 'p') {
|
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;
|
$totallen = (float)$totallen;
|
||||||
|
@ -407,7 +411,11 @@ class Torrent
|
||||||
if (!isset($value[''])) {
|
if (!isset($value[''])) {
|
||||||
$size += $fileTreeSize($value);
|
$size += $fileTreeSize($value);
|
||||||
} else {
|
} 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']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue