This commit is contained in:
Roman Kelesidis 2023-11-16 00:41:21 +07:00
parent e8e8ae6a73
commit 57cd76df63
5 changed files with 10 additions and 5 deletions

View File

@ -214,7 +214,7 @@ class ajax_common
function ajax_die($error_msg, $error_code = E_AJAX_GENERAL_ERROR)
{
$this->response['error_code'] = $error_code;
$this->response['error_msg'] = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $error_msg));
$this->response['error_msg'] = strip_tags(br2nl($error_msg));
// Get caller info
if (!empty($_COOKIE['explain']))
@ -323,7 +323,7 @@ class ajax_common
if (empty($confirm_msg)) $this->ajax_die('false');
$this->response['prompt_confirm'] = 1;
$this->response['confirm_msg'] = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $confirm_msg));
$this->response['confirm_msg'] = strip_tags(br2nl($confirm_msg));
$this->send();
}

View File

@ -155,7 +155,7 @@ if ($tor_reged && $tor_info)
// Magnet link
$passkey = DB()->fetch_row("SELECT auth_key FROM ". BB_BT_USERS ." WHERE user_id = ". (int) $bt_user_id ." LIMIT 1");
$tor_magnet = create_magnet($tor_info['info_hash'], $passkey['auth_key'], html_entity_decode($t_data['topic_title'], ENT_QUOTES, 'UTF-8'));
$tor_magnet = create_magnet($tor_info['info_hash'], $passkey['auth_key'], html_ent_decode($t_data['topic_title']));
// ratio limits
$min_ratio_dl = $bb_cfg['bt_min_ratio_allow_dl_tor'];

View File

@ -421,6 +421,11 @@ function htmlCHR ($txt, $double_encode = false, $quote_style = ENT_QUOTES, $char
return (string) htmlspecialchars($txt, $quote_style, $charset, $double_encode);
}
function br2nl ($txt)
{
return preg_replace('#<br\s*/?>#i', "\n", $txt);
}
function html_ent_decode ($txt, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
return (string) html_entity_decode($txt, $quote_style, $charset);

View File

@ -787,7 +787,7 @@ if ($allowed_forums)
$s_last = $tor['seeder_last_seen'];
$att_id = $tor['attach_id'];
$size = $tor['size'];
$tor_magnet = create_magnet($tor['info_hash'], $passkey['auth_key'], html_entity_decode($tor['topic_title'], ENT_QUOTES, 'UTF-8'));
$tor_magnet = create_magnet($tor['info_hash'], $passkey['auth_key'], html_ent_decode($tor['topic_title']));
$compl = $tor['complete_count'];
$dl_sp = ($dl) ? humn_size($dl, 0, 'KB') .'/s' : '0 KB/s';
$ul_sp = ($ul) ? humn_size($ul, 0, 'KB') .'/s' : '0 KB/s';

View File

@ -512,7 +512,7 @@ foreach ($topic_rowset as $topic)
if (isset($topic['tor_size']))
{
$tor_magnet = create_magnet($topic['info_hash'], $topic['auth_key'], html_entity_decode($topic['topic_title'], ENT_QUOTES, 'UTF-8'));
$tor_magnet = create_magnet($topic['info_hash'], $topic['auth_key'], html_ent_decode($topic['topic_title']));
$template->assign_block_vars('t.tor', array(
'SEEDERS' => (int) $topic['seeders'],