From 0ae3ab28ba22155b4805afb89b62101fd4bed624 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 28 Jun 2023 02:05:33 +0700 Subject: [PATCH] Minor improvements (#199) * Minor improvements * Update CHANGELOG.md * fix * Update CHANGELOG.md * Update mod_action.php * Update admin_user_search.tpl --- CHANGELOG.md | 2 +- admin/admin_ranks.php | 2 +- admin/admin_user_search.php | 2 +- bt/announce.php | 14 ++--- bt/scrape.php | 2 +- info.php | 2 +- library/ajax/avatar.php | 4 +- library/ajax/change_user_opt.php | 4 +- library/ajax/group_membership.php | 2 +- library/ajax/index_data.php | 2 +- library/ajax/manage_admin.php | 2 +- library/ajax/manage_user.php | 2 +- library/ajax/mod_action.php | 2 +- library/ajax/sitemap.php | 2 +- library/ajax/topic_tpl.php | 2 +- library/ajax/user_register.php | 2 +- modcp.php | 2 +- profile.php | 2 +- styles/templates/admin/admin_board.tpl | 52 +++++++++---------- styles/templates/admin/admin_extensions.tpl | 4 +- styles/templates/admin/admin_log.tpl | 2 +- .../templates/admin/admin_rebuild_search.tpl | 10 ++-- styles/templates/admin/admin_user_search.tpl | 2 +- 23 files changed, 61 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb28be9..488d38c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ **Merged pull requests:** - Release v2.1.5-2023.05 🎉 -- Minor improvements [\#167](https://github.com/torrentpier/torrentpier-lts/pull/167), [\#168](https://github.com/torrentpier/torrentpier-lts/pull/168), [\#169](https://github.com/torrentpier/torrentpier-lts/pull/169), [\#170](https://github.com/torrentpier/torrentpier-lts/pull/170) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#169](https://github.com/torrentpier/torrentpier-lts/pull/169), [\#170](https://github.com/torrentpier/torrentpier-lts/pull/170) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.1.5-2023.04](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.04) (2023-05-04) [Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.03...v2.1.5-2023.04) diff --git a/admin/admin_ranks.php b/admin/admin_ranks.php index b79b8e61..641ea54e 100644 --- a/admin/admin_ranks.php +++ b/admin/admin_ranks.php @@ -200,7 +200,7 @@ if ($mode != '') } else { - bb_die('Invalid mode: ' . htmlCHR($mode)); + bb_die('Invalid mode'); } } else diff --git a/admin/admin_user_search.php b/admin/admin_user_search.php index b7138fdc..d997a052 100644 --- a/admin/admin_user_search.php +++ b/admin/admin_user_search.php @@ -245,7 +245,7 @@ else break; default: - bb_die('Invalid mode: ' . htmlCHR($mode)); + bb_die('Invalid mode'); } $base_url = 'admin_user_search.php?dosearch=true'; diff --git a/bt/announce.php b/bt/announce.php index 1008fbb9..6268d47d 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -76,31 +76,31 @@ $passkey = isset($$passkey_key) ? $$passkey_key : null; // Required params (info_hash, peer_id, port, uploaded, downloaded, left, passkey) if (!isset($info_hash) || strlen($info_hash) != 20) { - msg_die('Invalid info_hash: ' . htmlCHR($info_hash)); + msg_die('Invalid info_hash'); } if (!isset($peer_id) || strlen($peer_id) != 20) { - msg_die('Invalid peer_id: ' . htmlCHR($peer_id)); + msg_die('Invalid peer_id'); } if (!isset($port) || $port < 0 || $port > 0xFFFF) { - msg_die('Invalid port: ' . htmlCHR($port)); + msg_die('Invalid port'); } if (!isset($uploaded) || $uploaded < 0 || $uploaded > $max_up_down_val || $uploaded == 1844674407370) { - msg_die('Invalid uploaded value: ' . htmlCHR($uploaded)); + msg_die('Invalid uploaded value'); } if (!isset($downloaded) || $downloaded < 0 || $downloaded > $max_up_down_val || $downloaded == 1844674407370) { - msg_die('Invalid downloaded value: ' . htmlCHR($downloaded)); + msg_die('Invalid downloaded value'); } if (!isset($left) || $left < 0 || $left > $max_left_val) { - msg_die('Invalid left value: ' . htmlCHR($left)); + msg_die('Invalid left value'); } if (!verify_id($passkey, BT_AUTH_KEY_LENGTH)) { - msg_die('Invalid passkey: ' . htmlCHR($passkey)); + msg_die('Invalid passkey'); } // IP diff --git a/bt/scrape.php b/bt/scrape.php index 72dc68ea..e09ebbb9 100644 --- a/bt/scrape.php +++ b/bt/scrape.php @@ -14,7 +14,7 @@ if (isset($_GET['?info_hash']) && !isset($_GET['info_hash'])) if (!isset($_GET['info_hash']) || strlen($_GET['info_hash']) != 20) { - msg_die('Invalid info_hash: ' . htmlCHR($_GET['info_hash'])); + msg_die('Invalid info_hash'); } $info_hash = $_GET['info_hash']; diff --git a/info.php b/info.php index 73e36542..500596c8 100644 --- a/info.php +++ b/info.php @@ -36,7 +36,7 @@ switch ($req_mode) break; default: - bb_simple_die('Invalid request: ' . htmlCHR($req_mode)); + bb_simple_die('Invalid request'); } $require = file_exists($html_dir . $info['src']) ? $html_dir . $info['src'] : $html_dir . 'not_found.html'; diff --git a/library/ajax/avatar.php b/library/ajax/avatar.php index 6c58ee8d..ef61deac 100644 --- a/library/ajax/avatar.php +++ b/library/ajax/avatar.php @@ -9,7 +9,7 @@ $user_id = (int) $this->request['user_id']; if (!$user_id OR !$u_data = get_userdata($user_id)) { - $this->ajax_die('Invalid user_id: ' . htmlCHR($user_id)); + $this->ajax_die('Invalid user_id'); } if (!IS_ADMIN && $user_id != $user->id) @@ -25,7 +25,7 @@ switch ($mode) $response = ''. $user_id .''; break; default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die('Invalid mode'); } DB()->query("UPDATE ". BB_USERS ." SET avatar_ext_id = $new_ext_id WHERE user_id = $user_id LIMIT 1"); diff --git a/library/ajax/change_user_opt.php b/library/ajax/change_user_opt.php index 7e02037f..db9fc94e 100644 --- a/library/ajax/change_user_opt.php +++ b/library/ajax/change_user_opt.php @@ -9,12 +9,12 @@ $new_opt = Zend\Json\Json::decode($this->request['user_opt'], Zend\Json\Json::TY if (!$user_id OR !$u_data = get_userdata($user_id)) { - $this->ajax_die('invalid user_id: ' . htmlCHR($user_id)); + $this->ajax_die('invalid user_id'); } if (!is_array($new_opt)) { - $this->ajax_die('invalid new_opt: ' . htmlCHR($new_opt)); + $this->ajax_die('invalid new_opt'); } foreach ($bf['user_opt'] as $opt_name => $opt_bit) diff --git a/library/ajax/group_membership.php b/library/ajax/group_membership.php index df0f0cdc..78b9c307 100644 --- a/library/ajax/group_membership.php +++ b/library/ajax/group_membership.php @@ -65,5 +65,5 @@ switch ($mode) break; default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die("invalid mode: $mode"); } \ No newline at end of file diff --git a/library/ajax/index_data.php b/library/ajax/index_data.php index a995a094..856361d5 100644 --- a/library/ajax/index_data.php +++ b/library/ajax/index_data.php @@ -132,7 +132,7 @@ switch($mode) break; default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die('Invalid mode'); } $this->response['html'] = $html; diff --git a/library/ajax/manage_admin.php b/library/ajax/manage_admin.php index 1437a0da..6f11a3d9 100644 --- a/library/ajax/manage_admin.php +++ b/library/ajax/manage_admin.php @@ -113,7 +113,7 @@ switch ($mode) default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die('Invalid mode'); } $this->response['mode'] = $mode; \ No newline at end of file diff --git a/library/ajax/manage_user.php b/library/ajax/manage_user.php index 0b2ce371..c13263a4 100644 --- a/library/ajax/manage_user.php +++ b/library/ajax/manage_user.php @@ -81,7 +81,7 @@ switch ($mode) default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die('Invalid mode'); } $this->response['mode'] = $mode; diff --git a/library/ajax/mod_action.php b/library/ajax/mod_action.php index 0446be60..7ae9d52a 100644 --- a/library/ajax/mod_action.php +++ b/library/ajax/mod_action.php @@ -131,5 +131,5 @@ switch ($mode) break; default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die('Invalid mode'); } diff --git a/library/ajax/sitemap.php b/library/ajax/sitemap.php index 9ad957ca..d573d352 100644 --- a/library/ajax/sitemap.php +++ b/library/ajax/sitemap.php @@ -39,7 +39,7 @@ switch ($mode) break; default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die('Invalid mode'); } $this->response['html'] = $html; diff --git a/library/ajax/topic_tpl.php b/library/ajax/topic_tpl.php index 6c8c11f7..fdc36634 100644 --- a/library/ajax/topic_tpl.php +++ b/library/ajax/topic_tpl.php @@ -154,7 +154,7 @@ switch ($mode) // ошибочный $mode default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die("invalid mode: $mode"); } // возможный дубль названия шаблона diff --git a/library/ajax/user_register.php b/library/ajax/user_register.php index f238162c..25b9ba13 100644 --- a/library/ajax/user_register.php +++ b/library/ajax/user_register.php @@ -68,7 +68,7 @@ switch($mode) break; default: - $this->ajax_die('Invalid mode: ' . htmlCHR($mode)); + $this->ajax_die('Invalid mode'); } $this->response['html'] = $html; diff --git a/modcp.php b/modcp.php index 65870575..25e97490 100644 --- a/modcp.php +++ b/modcp.php @@ -846,7 +846,7 @@ switch ($mode) break; default: - bb_die('Invalid action: ' . htmlCHR($mode)); + bb_die('invalid action'); break; } diff --git a/profile.php b/profile.php index 58c40a5f..244e18f3 100644 --- a/profile.php +++ b/profile.php @@ -46,5 +46,5 @@ switch ($mode) break; default: - bb_die('Invalid mode: ' . htmlCHR($mode)); + bb_die('Invalid mode'); } \ No newline at end of file diff --git a/styles/templates/admin/admin_board.tpl b/styles/templates/admin/admin_board.tpl index 4ef14ec6..bd3c1580 100644 --- a/styles/templates/admin/admin_board.tpl +++ b/styles/templates/admin/admin_board.tpl @@ -42,44 +42,44 @@

{L_AUTOLOGIN_TIME}

{L_AUTOLOGIN_TIME_EXPLAIN}
- {L_DAYS} + {L_DAYS}

{L_FLOOD_INTERVAL}

{L_FLOOD_INTERVAL_EXPLAIN}
- {L_SEC} + {L_SEC}

{L_TOPICS_PER_PAGE}

- +

{L_POSTS_PER_PAGE}

- +

{L_HOT_THRESHOLD}

- +

{L_DEFAULT_LANGUAGE}

@@ -105,7 +105,7 @@

{L_MAX_POLL_OPTIONS}

- +

{L_ALLOW_BBCODE}

@@ -134,7 +134,7 @@

{L_MAX_SIG_LENGTH}

{L_MAX_SIG_LENGTH_EXPLAIN}
- +

{L_ALLOW_NAME_CHANGE}

@@ -237,15 +237,15 @@

{L_MAX_NEWS_TITLE}

- +

{L_NEWS_COUNT}

- +

{L_NEWS_FORUM_ID}

- + @@ -260,15 +260,15 @@

{L_MAX_NEWS_TITLE}

- +

{L_NEWS_COUNT}

- +

{L_NEWS_FORUM_ID}

- + @@ -283,15 +283,15 @@

{L_BIRTHDAY_MAX_AGE}

-  {L_YEARS} +  {L_YEARS}

{L_BIRTHDAY_MIN_AGE}

-  {L_YEARS} +  {L_YEARS}

{L_BIRTHDAY_CHECK_DAY}

-  {L_DAYS} +  {L_DAYS} @@ -311,8 +311,8 @@ {L_SEED_BONUS_ADD} -  {L_SEED_BONUS_RELEASE}
-  {L_SEED_BONUS_POINTS}   +  {L_SEED_BONUS_RELEASE}
+  {L_SEED_BONUS_POINTS}   @@ -321,8 +321,8 @@ {L_SEED_BONUS_ADD} -  {L_SEED_BONUS_RELEASE}
-  {L_SEED_BONUS_POINTS} +  {L_SEED_BONUS_RELEASE}
+  {L_SEED_BONUS_POINTS} @@ -331,11 +331,11 @@ {L_SEED_BONUS_TOR_SIZE} -  {L_GB} +  {L_GB} {L_SEED_BONUS_USER_REGDATA} -  {L_DAYS} +  {L_DAYS} {L_SEED_BONUS_EXCHANGE} @@ -354,8 +354,8 @@

{L_SEED_BONUS_ROPORTION}

-  {L_GB}
-  {L_PRICE} +  {L_GB}
+  {L_PRICE} diff --git a/styles/templates/admin/admin_extensions.tpl b/styles/templates/admin/admin_extensions.tpl index 945f87b3..5757d805 100644 --- a/styles/templates/admin/admin_extensions.tpl +++ b/styles/templates/admin/admin_extensions.tpl @@ -93,7 +93,7 @@ {S_ADD_DOWNLOAD_MODE} - {S_FILESIZE} + {S_FILESIZE}   @@ -125,7 +125,7 @@ {grouprow.S_DOWNLOAD_MODE} - {grouprow.S_FILESIZE} + {grouprow.S_FILESIZE} {L_EXT_GROUP_PERMISSIONS} diff --git a/styles/templates/admin/admin_log.tpl b/styles/templates/admin/admin_log.tpl index 1036d458..32462d50 100644 --- a/styles/templates/admin/admin_log.tpl +++ b/styles/templates/admin/admin_log.tpl @@ -58,7 +58,7 @@ table.log_filters td {

& - + {L_ACTS_LOG_DAYS_BACK}

diff --git a/styles/templates/admin/admin_rebuild_search.tpl b/styles/templates/admin/admin_rebuild_search.tpl index 28035eee..f826c845 100644 --- a/styles/templates/admin/admin_rebuild_search.tpl +++ b/styles/templates/admin/admin_rebuild_search.tpl @@ -58,7 +58,7 @@ function swap_values()

{L_STARTING_POST_ID}

{L_STARTING_POST_ID_EXPLAIN}
- + @@ -79,19 +79,19 @@ function swap_values()

{L_NUM_OF_POSTS}

{L_NUM_OF_POSTS_EXPLAIN}
- +

{L_POSTS_PER_CYCLE}

{L_POSTS_PER_CYCLE_EXPLAIN}
- +

{L_TIME_LIMIT}

{L_TIME_LIMIT_EXPLAIN}
- +

{L_REFRESH_RATE}

{L_REFRESH_RATE_EXPLAIN}
- + diff --git a/styles/templates/admin/admin_user_search.tpl b/styles/templates/admin/admin_user_search.tpl index 9cd08bb4..d55741e7 100644 --- a/styles/templates/admin/admin_user_search.tpl +++ b/styles/templates/admin/admin_user_search.tpl @@ -53,7 +53,7 @@ - {L_POSTCOUNT}   
{L_SEARCH_USERS_POSTCOUNT_EXPLAIN} + {L_POSTCOUNT}   
{L_SEARCH_USERS_POSTCOUNT_EXPLAIN}