This commit is contained in:
Cønstantine Kovalensky 2023-11-24 18:34:00 +04:00 committed by GitHub
commit 4c0a9c0bc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View file

@ -394,11 +394,13 @@ class Torrent
foreach ($info['files'] as $fn => $f) {
// Exclude padding files
if (($f['attr'] ?? null) !== 'p') {
$totallen += (isset($f['length']) && is_numeric($f['length'])) ? (float)$f['length'] : self::torrent_error_exit($lang['TORFILE_INVALID']);
$totallen += (isset($f['length']) && is_numeric($f['length'])) ? $f['length'] : self::torrent_error_exit($lang['TORFILE_INVALID']);
}
}
$totallen = (float)$totallen;
} elseif (isset($bt_v2)) {
$fileTreeSize = function (array $array, string $name = '') use (&$fileTreeSize) {
global $lang;
$size = 0;
@ -406,7 +408,7 @@ class Torrent
if (!isset($value[''])) {
$size += $fileTreeSize($value);
} else {
$size += (isset($value['']['length']) && is_numeric($value['']['length'])) ? (float)$value['']['length'] : self::torrent_error_exit($lang['TORFILE_INVALID']);
$size += (isset($value['']['length']) && is_numeric($value['']['length'])) ? $value['']['length'] : self::torrent_error_exit($lang['TORFILE_INVALID']);
}
}

View file

@ -147,7 +147,7 @@ class TorrentFileList
$html_v2 = $this->fileTreeList($value);
$allItems .= "<li><span class=\"b\">$key</span><ul>$html_v2</ul></li>";
} else {
$length = (float)$value['']['length'];
$length = $value['']['length'];
$root = bin2hex($value['']['pieces root'] ?? '');
$allItems .= "<li><span>$key<i>$length</i><p>$root</p></span></li>";
}
@ -172,7 +172,7 @@ class TorrentFileList
if (!isset($value[''])) {
$this->fileTreeTable($value, $current);
} else {
$length = (float)$value['']['length'];
$length = $value['']['length'];
$root = bin2hex($value['']['pieces root'] ?? '');
$filesList['list'] .= '<tr><td>' . $current . '</td><td>' . humn_size($length, 2) . '</td><td>' . $root . '</td></tr><tr>';
$filesList['count']++;

View file

@ -169,7 +169,7 @@
<p class="small">{postrow.attach.tor_reged.FILESIZE}</p>
<p style="padding-top: 6px;"><input id="tor-filelist-btn" type="button" class="lite" value="{L_FILELIST}" /></p>
<!-- IF postrow.attach.tor_reged.HASH_V2 -->
<p><a href="{FULL_URL}viewtopic.php?filelist&topic={TOPIC_ID}" title = "File hashes | Detailed .torrent meta info" target="_blank">...</a></p>
<p><a href="{FULL_URL}viewtopic.php?filelist&topic={TOPIC_ID}" title = "File hashes | .torrent meta-info" target="_blank">...</a></p>
<!-- ENDIF -->
</td>
</tr>