mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Exception handling for Bencode errors (#1239)
This commit is contained in:
parent
a953045aba
commit
586fc0b563
3 changed files with 5 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue