Minor improvements (#1243)

* Minor improvements

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-12-21 11:23:08 +07:00 committed by GitHub
commit c4df759d09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 10 deletions

View file

@ -19,7 +19,7 @@
- search.php parameter sanitizing [\#1213](https://github.com/torrentpier/torrentpier/pull/1213) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka)) - search.php parameter sanitizing [\#1213](https://github.com/torrentpier/torrentpier/pull/1213) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka))
- Limit execution time for forum file-listing [\#1211](https://github.com/torrentpier/torrentpier/pull/1211) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka)) - Limit execution time for forum file-listing [\#1211](https://github.com/torrentpier/torrentpier/pull/1211) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka))
- Some reported bugfixes [\#1214](https://github.com/torrentpier/torrentpier/pull/1214) ([belomaxorka](https://github.com/belomaxorka)) - Some reported bugfixes [\#1214](https://github.com/torrentpier/torrentpier/pull/1214) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1215](https://github.com/torrentpier/torrentpier/pull/1215), [\#1217](https://github.com/torrentpier/torrentpier/pull/1217), [\#1219](https://github.com/torrentpier/torrentpier/pull/1219), [\#1220](https://github.com/torrentpier/torrentpier/pull/1220), [\#1224](https://github.com/torrentpier/torrentpier/pull/1224), [\#1228](https://github.com/torrentpier/torrentpier/pull/1228), [\#1229](https://github.com/torrentpier/torrentpier/pull/1229), [\#1230](https://github.com/torrentpier/torrentpier/pull/1230), [\#1234](https://github.com/torrentpier/torrentpier/pull/1234), [\#1236](https://github.com/torrentpier/torrentpier/pull/1236) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1215](https://github.com/torrentpier/torrentpier/pull/1215), [\#1217](https://github.com/torrentpier/torrentpier/pull/1217), [\#1219](https://github.com/torrentpier/torrentpier/pull/1219), [\#1220](https://github.com/torrentpier/torrentpier/pull/1220), [\#1224](https://github.com/torrentpier/torrentpier/pull/1224), [\#1228](https://github.com/torrentpier/torrentpier/pull/1228), [\#1229](https://github.com/torrentpier/torrentpier/pull/1229), [\#1230](https://github.com/torrentpier/torrentpier/pull/1230), [\#1234](https://github.com/torrentpier/torrentpier/pull/1234), [\#1236](https://github.com/torrentpier/torrentpier/pull/1236), [\#1243](https://github.com/torrentpier/torrentpier/pull/1243) ([belomaxorka](https://github.com/belomaxorka))
- Fixed extensions issue [\#1218](https://github.com/torrentpier/torrentpier/pull/1218) ([belomaxorka](https://github.com/belomaxorka)) - Fixed extensions issue [\#1218](https://github.com/torrentpier/torrentpier/pull/1218) ([belomaxorka](https://github.com/belomaxorka))
- Fixed broken sorting in group.php [\#1221](https://github.com/torrentpier/torrentpier/pull/1221) ([belomaxorka](https://github.com/belomaxorka)) - Fixed broken sorting in group.php [\#1221](https://github.com/torrentpier/torrentpier/pull/1221) ([belomaxorka](https://github.com/belomaxorka))
- Code re-formatting [\#1225](https://github.com/torrentpier/torrentpier/pull/1225) ([kovalensky](https://github.com/kovalensky)) - Code re-formatting [\#1225](https://github.com/torrentpier/torrentpier/pull/1225) ([kovalensky](https://github.com/kovalensky))

View file

@ -30,7 +30,7 @@ if (!file_exists($filename) || !$file_contents = file_get_contents($filename)) {
try { try {
$tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY); $tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY);
} catch (\Exception) { } catch (\Exception $e) {
$this->response['html'] = $lang['TORFILE_INVALID']; $this->response['html'] = $lang['TORFILE_INVALID'];
return; return;
} }

View file

@ -62,7 +62,7 @@ if ($bb_cfg['flist_max_files']) {
try { try {
$torrent = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY); $torrent = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY);
} catch (\Exception) { } catch (\Exception $e) {
http_response_code(410); http_response_code(410);
die($lang['TORFILE_INVALID']); die($lang['TORFILE_INVALID']);
} }

View file

@ -735,18 +735,31 @@ class Attach
$this->type = $_FILES['fileupload']['type']; $this->type = $_FILES['fileupload']['type'];
if (isset($_FILES['fileupload']['error'])) { if (isset($_FILES['fileupload']['error'])) {
switch($_FILES['fileupload']['error']) { switch ($_FILES['fileupload']['error']) {
case UPLOAD_ERR_NO_FILE: case UPLOAD_ERR_NO_FILE:
bb_die('No file content sent'); bb_die('No file content sent');
// no break break;
case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_INI_SIZE:
bb_die('upload_max_filesize setting: ' . ini_get('upload_max_filesize')); bb_die('upload_max_filesize setting: ' . ini_get('upload_max_filesize'));
// no break break;
case UPLOAD_ERR_FORM_SIZE:
bb_die('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form');
break;
case UPLOAD_ERR_CANT_WRITE: case UPLOAD_ERR_CANT_WRITE:
bb_die('Failed to write file to disk, check permissions'); bb_die('Failed to write file to disk, check permissions');
// no break break;
case UPLOAD_ERR_PARTIAL: case UPLOAD_ERR_PARTIAL:
bb_die('The uploaded file was only partially uploaded'); bb_die('The uploaded file was only partially uploaded');
break;
case UPLOAD_ERR_EXTENSION:
bb_die('File upload stopped by extension');
break;
case UPLOAD_ERR_NO_TMP_DIR:
bb_die('Missing a temporary folder');
break;
default:
bb_die('Unknown upload error');
break;
} }
} }

View file

@ -563,7 +563,7 @@ class Torrent
$file_contents = file_get_contents($filename); $file_contents = file_get_contents($filename);
try { try {
$tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY); $tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY);
} catch (\Exception) { } catch (\Exception $e) {
bb_die($lang['TORFILE_INVALID']); bb_die($lang['TORFILE_INVALID']);
} }

View file

@ -381,7 +381,7 @@ function build_poll_add_form (src_el)
<p style="float: left;<!-- IF TEXT_BUTTONS --> padding: 4px 0 3px;<!-- ELSE --> padding-top: 5px;<!-- ENDIF -->"> <p style="float: left;<!-- IF TEXT_BUTTONS --> padding: 4px 0 3px;<!-- ELSE --> padding-top: 5px;<!-- ENDIF -->">
<!-- IF postrow.IS_UNREAD -->{MINIPOST_IMG_NEW}<!-- ELSE -->{MINIPOST_IMG}<!-- ENDIF --> <!-- IF postrow.IS_UNREAD -->{MINIPOST_IMG_NEW}<!-- ELSE -->{MINIPOST_IMG}<!-- ENDIF -->
<a class="small" href="{POST_URL}{postrow.POST_ID}#{postrow.POST_ID}" title="{L_POST_LINK}">{postrow.POST_DATE}&nbsp;|&nbsp;#{postrow.POST_NUMBER}</a> <a class="small" href="{POST_URL}{postrow.POST_ID}#{postrow.POST_ID}" title="{L_POST_LINK}">{postrow.POST_DATE}&nbsp;|&nbsp;#{postrow.POST_NUMBER}</a>
<!-- IF postrow.POSTER_AUTHOR -->&middot;&nbsp;<span>{L_AUTHOR}</span><!-- ENDIF --> <!-- IF postrow.POSTER_AUTHOR and not postrow.POSTER_GUEST -->&middot;&nbsp;<span>{L_AUTHOR}</span><!-- ENDIF -->
<!-- IF postrow.POSTED_AFTER --> <!-- IF postrow.POSTED_AFTER -->
<span class="posted_since">({L_POSTED_AFTER} {postrow.POSTED_AFTER})</span> <span class="posted_since">({L_POSTED_AFTER} {postrow.POSTED_AFTER})</span>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -697,7 +697,7 @@ for ($i = 0; $i < $total_posts; $i++) {
'POSTER_BOT' => $poster_bot, 'POSTER_BOT' => $poster_bot,
'POSTER_GUEST' => $poster_guest, 'POSTER_GUEST' => $poster_guest,
'POSTER_ID' => $poster_id, 'POSTER_ID' => $poster_id,
'POSTER_AUTHOR' => !$poster_guest && ($poster_id == $t_data['topic_poster']), 'POSTER_AUTHOR' => ($poster_id == $t_data['topic_poster']),
'POSTER_GENDER' => !$poster_guest ? genderImage((int)$postrow[$i]['user_gender']) : '', 'POSTER_GENDER' => !$poster_guest ? genderImage((int)$postrow[$i]['user_gender']) : '',
'POSTED_AFTER' => $prev_post_time ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '', 'POSTED_AFTER' => $prev_post_time ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '',
'IS_UNREAD' => is_unread($postrow[$i]['post_time'], $topic_id, $forum_id), 'IS_UNREAD' => is_unread($postrow[$i]['post_time'], $topic_id, $forum_id),