diff --git a/library/ajax/view_torrent.php b/library/ajax/view_torrent.php index af3b5ef5d..29c32b18f 100644 --- a/library/ajax/view_torrent.php +++ b/library/ajax/view_torrent.php @@ -30,9 +30,9 @@ if (!file_exists($filename) || !$file_contents = file_get_contents($filename)) { try { $tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY); -} -catch (Exception) { - return $lang['TORFILE_INVALID']; +} catch (Exception) { + $this->response['html'] = $lang['TORFILE_INVALID']; + return; } $torrent = new TorrentPier\Legacy\TorrentFileList($tor); diff --git a/library/includes/file_list_v2.php b/library/includes/file_list_v2.php index 240298c52..79fa835b2 100644 --- a/library/includes/file_list_v2.php +++ b/library/includes/file_list_v2.php @@ -62,8 +62,7 @@ if ($bb_cfg['flist_max_files']) { try { $torrent = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY); -} -catch (Exception) { +} catch (Exception) { http_response_code(410); die($lang['TORFILE_INVALID']); } diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index dbbb8ec35..4a561f0a6 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -564,8 +564,7 @@ class Torrent $file_contents = file_get_contents($filename); try { $tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY); - } - catch (Exception) { + } catch (Exception) { bb_die($lang['TORFILE_INVALID']); }