mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Use hardcoded dictionary names for better counting result in file listing (#1247)
Thanks to @arokettu for pointing this out.
This commit is contained in:
parent
486e5cc7d2
commit
573c772798
1 changed files with 3 additions and 3 deletions
|
@ -50,9 +50,9 @@ if (!is_file($file_path)) {
|
||||||
$file_contents = file_get_contents($file_path);
|
$file_contents = file_get_contents($file_path);
|
||||||
|
|
||||||
if ($bb_cfg['flist_max_files']) {
|
if ($bb_cfg['flist_max_files']) {
|
||||||
$filetree_pos = strpos($file_contents, ':file tree');
|
$filetree_pos = strpos($file_contents, '9:file tree');
|
||||||
$files_pos = !empty($row['info_hash']) ? strpos($file_contents, ':files', $filetree_pos) : false;
|
$files_pos = !empty($row['info_hash']) ? strpos($file_contents, '5:files', $filetree_pos) : false;
|
||||||
$file_count = substr_count($file_contents, ':length', $filetree_pos, ($files_pos ? ($files_pos - $filetree_pos) : null));
|
$file_count = substr_count($file_contents, '6:length', $filetree_pos, ($files_pos ? ($files_pos - $filetree_pos) : null));
|
||||||
|
|
||||||
if ($file_count > $bb_cfg['flist_max_files']) {
|
if ($file_count > $bb_cfg['flist_max_files']) {
|
||||||
http_response_code(410);
|
http_response_code(410);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue