diff --git a/library/includes/file_list_v2.php b/library/includes/file_list_v2.php index c5db0e2e4..78d949048 100644 --- a/library/includes/file_list_v2.php +++ b/library/includes/file_list_v2.php @@ -50,9 +50,9 @@ if (!is_file($file_path)) { $file_contents = file_get_contents($file_path); if ($bb_cfg['flist_max_files']) { - $filetree_pos = strpos($file_contents, ':file tree'); - $files_pos = !empty($row['info_hash']) ? strpos($file_contents, ':files', $filetree_pos) : false; - $file_count = substr_count($file_contents, ':length', $filetree_pos, ($files_pos ? ($files_pos - $filetree_pos) : null)); + $filetree_pos = strpos($file_contents, '9:file tree'); + $files_pos = !empty($row['info_hash']) ? strpos($file_contents, '5:files', $filetree_pos) : false; + $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']) { http_response_code(410);