Minor improvements (#1248)

* WIP: Minor improvements

* Update Torrent.php

* Updated

* Updated

* Revert "Updated"

This reverts commit e98a5dfe9c.

* Revert "Updated"

This reverts commit 0b53396c56.

* Update group.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-12-22 16:04:16 +07:00 committed by GitHub
commit d57bf5265a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 14 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), [\#1243](https://github.com/torrentpier/torrentpier/pull/1243) ([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), [\#1248](https://github.com/torrentpier/torrentpier/pull/1248) ([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))
@ -27,6 +27,11 @@
- Fixed set auth cookie issue [\#1227](https://github.com/torrentpier/torrentpier/pull/1227) ([belomaxorka](https://github.com/belomaxorka)) - Fixed set auth cookie issue [\#1227](https://github.com/torrentpier/torrentpier/pull/1227) ([belomaxorka](https://github.com/belomaxorka))
- Fixed broken captcha check on login.php [\#1233](https://github.com/torrentpier/torrentpier/pull/1233) ([belomaxorka](https://github.com/belomaxorka)) - Fixed broken captcha check on login.php [\#1233](https://github.com/torrentpier/torrentpier/pull/1233) ([belomaxorka](https://github.com/belomaxorka))
- Hide vote button in poll if user already voted [\#1235](https://github.com/torrentpier/torrentpier/pull/1235) ([belomaxorka](https://github.com/belomaxorka)) - Hide vote button in poll if user already voted [\#1235](https://github.com/torrentpier/torrentpier/pull/1235) ([belomaxorka](https://github.com/belomaxorka))
- Exception handling for Bencode errors [\#1237](https://github.com/torrentpier/torrentpier/pull/1237), [\#1239](https://github.com/torrentpier/torrentpier/pull/1239) ([kovalensky](https://github.com/kovalensky))
- Handle & show upload_max_filesize occurrences [\#1241](https://github.com/torrentpier/torrentpier/pull/1241) ([kovalensky](https://github.com/kovalensky))
- Little improvements [\#1244](https://github.com/torrentpier/torrentpier/pull/1244) ([kovalensky](https://github.com/kovalensky))
- Improved handling errors while uploading [\#1246](https://github.com/torrentpier/torrentpier/pull/1246)
- Use hardcoded dictionary names for better counting result in file listing [\#1247](https://github.com/torrentpier/torrentpier/pull/1247) ([kovalensky](https://github.com/kovalensky))
- New Crowdin updates [\#1203](https://github.com/torrentpier/torrentpier/pull/1203), [\#1222](https://github.com/torrentpier/torrentpier/pull/1222) ([Exileum](https://github.com/Exileum)) - New Crowdin updates [\#1203](https://github.com/torrentpier/torrentpier/pull/1203), [\#1222](https://github.com/torrentpier/torrentpier/pull/1222) ([Exileum](https://github.com/Exileum))
## [v2.4.0-rc2](https://github.com/torrentpier/torrentpier/tree/v2.4.0-rc2) (2023-12-12) ## [v2.4.0-rc2](https://github.com/torrentpier/torrentpier/tree/v2.4.0-rc2) (2023-12-12)

View file

@ -162,7 +162,7 @@ if (!$group_id) {
bb_die($lang['NO_GROUPS_EXIST']); bb_die($lang['NO_GROUPS_EXIST']);
} }
if ($row['user_id']) { if ($row['user_id']) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['ALREADY_MEMBER_GROUP']); bb_die($lang['ALREADY_MEMBER_GROUP']);
} }
@ -185,12 +185,12 @@ if (!$group_id) {
$emailer->send(); $emailer->send();
} }
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['GROUP_JOINED']); bb_die($lang['GROUP_JOINED']);
} elseif (!empty($_POST['unsub']) || !empty($_POST['unsubpending'])) { } elseif (!empty($_POST['unsub']) || !empty($_POST['unsubpending'])) {
\TorrentPier\Legacy\Group::delete_user_group($group_id, $userdata['user_id']); \TorrentPier\Legacy\Group::delete_user_group($group_id, $userdata['user_id']);
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['UNSUB_SUCCESS']); bb_die($lang['UNSUB_SUCCESS']);
} else { } else {
// Handle Additions, removals, approvals and denials // Handle Additions, removals, approvals and denials
@ -198,26 +198,26 @@ if (!$group_id) {
if (!empty($_POST['add']) || !empty($_POST['remove']) || !empty($_POST['approve']) || !empty($_POST['deny'])) { if (!empty($_POST['add']) || !empty($_POST['remove']) || !empty($_POST['approve']) || !empty($_POST['deny'])) {
if (!$is_moderator) { if (!$is_moderator) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['NOT_GROUP_MODERATOR']); bb_die($lang['NOT_GROUP_MODERATOR']);
} }
if (!empty($_POST['add'])) { if (!empty($_POST['add'])) {
if (isset($_POST['username']) && !($row = get_userdata($_POST['username'], true))) { if (isset($_POST['username']) && !($row = get_userdata($_POST['username'], true))) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['COULD_NOT_ADD_USER']); bb_die($lang['COULD_NOT_ADD_USER']);
} }
// Prevent adding moderator // Prevent adding moderator
if ($row['user_id'] == $group_moderator) { if ($row['user_id'] == $group_moderator) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die(sprintf($lang['USER_IS_MOD_GROUP'], profile_url($row))); bb_die(sprintf($lang['USER_IS_MOD_GROUP'], profile_url($row)));
} }
// Prevent infinity user adding into group // Prevent infinity user adding into group
if ($is_member = DB()->fetch_row("SELECT user_id FROM " . BB_USER_GROUP . " WHERE group_id = $group_id AND user_id = " . $row['user_id'] . " LIMIT 1")) { if ($is_member = DB()->fetch_row("SELECT user_id FROM " . BB_USER_GROUP . " WHERE group_id = $group_id AND user_id = " . $row['user_id'] . " LIMIT 1")) {
if ($is_member['user_id']) { if ($is_member['user_id']) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die(sprintf($lang['USER_IS_MEMBER_GROUP'], profile_url($row))); bb_die(sprintf($lang['USER_IS_MEMBER_GROUP'], profile_url($row)));
} }
} }
@ -248,7 +248,7 @@ if (!$group_id) {
$sql_in[] = (int)$members_id; $sql_in[] = (int)$members_id;
} }
if (!$sql_in = implode(',', $sql_in)) { if (!$sql_in = implode(',', $sql_in)) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['NONE_SELECTED']); bb_die($lang['NONE_SELECTED']);
} }
@ -418,7 +418,7 @@ if (!$group_id) {
// TODO Correct SQL to posts with attach and limit them, optimization // TODO Correct SQL to posts with attach and limit them, optimization
if (!$group_info['release_group']) { if (!$group_info['release_group']) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['NOT_A_RELEASE_GROUP']); bb_die($lang['NOT_A_RELEASE_GROUP']);
} }
@ -449,7 +449,7 @@ if (!$group_id) {
"; ";
if (!$releases = DB()->fetch_rowset($sql)) { if (!$releases = DB()->fetch_rowset($sql)) {
set_die_append_msg(false, false, $group_id); set_die_append_msg(group_id: $group_id);
bb_die($lang['NO_SEARCH_MATCH']); bb_die($lang['NO_SEARCH_MATCH']);
} }

View file

@ -474,8 +474,7 @@ class Torrent
if ($reg_mode == 'request' || $reg_mode == 'newtopic') { if ($reg_mode == 'request' || $reg_mode == 'newtopic') {
set_die_append_msg($forum_id, $topic_id); set_die_append_msg($forum_id, $topic_id);
$mess = sprintf($lang['BT_REGISTERED'], DL_URL . $attach_id); bb_die(sprintf($lang['BT_REGISTERED'], DL_URL . $attach_id));
bb_die($mess);
} }
return true; return true;

View file

@ -634,7 +634,7 @@ function build_poll_add_form (src_el)
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF IS_ADMIN --> <!-- IF IS_ADMIN -->
<div class="med" style="float: right;"> <div class="med" style="float: right;">
Admin:&nbsp; {L_ADMIN}:&nbsp;
<a href="{U_LOGS}">{L_LOGS}</a>&nbsp; <a href="{U_LOGS}">{L_LOGS}</a>&nbsp;
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->