Minor improvements (#988)

This commit is contained in:
Roman Kelesidis 2023-10-25 23:31:39 +07:00 committed by GitHub
commit 8fa4758ebe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 8 deletions

View file

@ -75,10 +75,7 @@ if (isset($_POST['submit'])) {
$emailer->set_reply($reply_to);
$emailer->set_template('admin_send_email');
$emailer->assign_vars([
'SUBJECT' => html_entity_decode($subject),
'MESSAGE' => html_entity_decode($message)
]);
$emailer->assign_vars(['MESSAGE' => trim(html_entity_decode($message))]);
$emailer->send($message_type);
}

View file

@ -126,6 +126,7 @@ $ip_sql = \TorrentPier\Helpers\IPHelper::ip2long($ip);
// Peer unique id
$peer_hash = hash('xxh128', rtrim($info_hash, ' ') . $passkey . $ip . $port);
// Events
$stopped = ($event === 'stopped');
@ -425,8 +426,10 @@ if (!$output) {
$peers_list_cached = CACHE('tr_cache')->set(PEERS_LIST_PREFIX . $topic_id, $output, PEERS_LIST_EXPIRE);
}
$output['external ip'] = inet_pton($ip);
$output['warning message'] = 'Statistics were updated';
// Return data to client
echo \Arokettu\Bencode\Bencode::encode($output);

View file

@ -1232,7 +1232,7 @@ function get_user_torrent_client(string $peer_id): mixed
}
if (!empty($bestMatch)) {
return '<img width="auto" height="auto" style="display:inline!important;vertical-align:middle" src="/styles/images/clients/'. $bestMatch .'.png" alt="' . $bestMatch . '" title="' . $peer_id . '">';
return '<img width="auto" height="auto" style="display:inline!important;vertical-align:middle" src="/styles/images/clients/' . $bestMatch . '.png" alt="' . $bestMatch . '" title="' . $peer_id . '">';
} else {
return $peer_id;
}

View file

@ -40,7 +40,6 @@ if ($row = DB()->fetch_row($sql)) {
$user_email = $row['user_email'];
$user_lang = $row['user_lang'];
if (isset($_POST['submit'])) {
$subject = trim(html_entity_decode($_POST['subject']));
$message = trim(html_entity_decode($_POST['message']));

View file

@ -72,7 +72,7 @@ switch ($mode) {
'user_password' => true,
'user_email' => true,
'user_timezone' => true,
'user_lang' => true,
'user_lang' => $bb_cfg['allow_change']['language'],
'user_opt' => true
];
@ -102,7 +102,7 @@ switch ($mode) {
'username' => IS_ADMIN || $bb_cfg['allow_namechange'],
'user_password' => true,
'user_email' => true, // должен быть после user_password
'user_lang' => true,
'user_lang' => $bb_cfg['allow_change']['language'],
'user_gender' => $bb_cfg['gender'],
'user_birthday' => $bb_cfg['birthday_enabled'],
'user_timezone' => true,