Little improvements (#1244)

This commit is contained in:
Cønstantine Kovalensky 2023-12-21 09:10:34 +04:00 committed by GitHub
commit fbc4749ca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 8 deletions

View file

@ -31,7 +31,7 @@ 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 $e) {
$this->response['html'] = $lang['TORFILE_INVALID'];
$this->response['html'] = htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}");
return;
}

View file

@ -64,7 +64,7 @@ try {
$torrent = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY);
} catch (\Exception $e) {
http_response_code(410);
die($lang['TORFILE_INVALID']);
die(htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}"));
}
if (isset($torrent['info']['private']) && IS_GUEST) {

View file

@ -740,7 +740,7 @@ class Attach
bb_die('No file content sent');
break;
case UPLOAD_ERR_INI_SIZE:
bb_die('upload_max_filesize setting: ' . ini_get('upload_max_filesize'));
bb_die('php.ini<br><b>upload_max_filesize</b> setting: ' . ini_get('upload_max_filesize'));
break;
case UPLOAD_ERR_FORM_SIZE:
bb_die('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form');
@ -757,9 +757,6 @@ class Attach
case UPLOAD_ERR_NO_TMP_DIR:
bb_die('Missing a temporary folder');
break;
default:
bb_die('Unknown upload error');
break;
}
}

View file

@ -320,7 +320,7 @@ class Torrent
try {
$tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY);
} catch (\Exception $e) {
self::torrent_error_exit($lang['TORFILE_INVALID']);
self::torrent_error_exit(htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}"));
}
if ($bb_cfg['bt_disable_dht']) {
@ -564,7 +564,7 @@ class Torrent
try {
$tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY);
} catch (\Exception $e) {
bb_die($lang['TORFILE_INVALID']);
bb_die(htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}"));
}
// Get tracker announcer