diff --git a/CHANGELOG.md b/CHANGELOG.md index 8396c0492..394ab9757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) - 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)) -- 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 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)) diff --git a/library/ajax/view_torrent.php b/library/ajax/view_torrent.php index e40364626..d0afdeb37 100644 --- a/library/ajax/view_torrent.php +++ b/library/ajax/view_torrent.php @@ -30,7 +30,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) { +} catch (\Exception $e) { $this->response['html'] = $lang['TORFILE_INVALID']; return; } diff --git a/library/includes/file_list_v2.php b/library/includes/file_list_v2.php index f1f770ff5..0d40072ef 100644 --- a/library/includes/file_list_v2.php +++ b/library/includes/file_list_v2.php @@ -62,7 +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 $e) { http_response_code(410); die($lang['TORFILE_INVALID']); } diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index 9e1d928c5..691d39eaa 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -735,18 +735,31 @@ class Attach $this->type = $_FILES['fileupload']['type']; if (isset($_FILES['fileupload']['error'])) { - switch($_FILES['fileupload']['error']) { + switch ($_FILES['fileupload']['error']) { case UPLOAD_ERR_NO_FILE: bb_die('No file content sent'); - // no break + break; case UPLOAD_ERR_INI_SIZE: 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: bb_die('Failed to write file to disk, check permissions'); - // no break + break; case UPLOAD_ERR_PARTIAL: 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; } } diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index 39a1defaf..4bf44e428 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -563,7 +563,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 $e) { bb_die($lang['TORFILE_INVALID']); } diff --git a/styles/templates/default/viewtopic.tpl b/styles/templates/default/viewtopic.tpl index fd52271cd..406a9eea5 100644 --- a/styles/templates/default/viewtopic.tpl +++ b/styles/templates/default/viewtopic.tpl @@ -381,7 +381,7 @@ function build_poll_add_form (src_el)

{MINIPOST_IMG_NEW}{MINIPOST_IMG} {postrow.POST_DATE} | #{postrow.POST_NUMBER} - · {L_AUTHOR} + · {L_AUTHOR} ({L_POSTED_AFTER} {postrow.POSTED_AFTER}) diff --git a/viewtopic.php b/viewtopic.php index ed24fe833..e721014f9 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -697,7 +697,7 @@ for ($i = 0; $i < $total_posts; $i++) { 'POSTER_BOT' => $poster_bot, 'POSTER_GUEST' => $poster_guest, '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']) : '', '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),