mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Used br2nl() in ajax alert messages (#1106)
This commit is contained in:
parent
b1bd25d32a
commit
b82c19719c
3 changed files with 17 additions and 6 deletions
|
@ -21,7 +21,7 @@ $bb_cfg = [];
|
|||
$bb_cfg['js_ver'] = $bb_cfg['css_ver'] = 1;
|
||||
|
||||
// Version info
|
||||
$bb_cfg['tp_version'] = 'v2.4.0-beta4';
|
||||
$bb_cfg['tp_version'] = 'v2.4.0-rc1';
|
||||
$bb_cfg['tp_release_date'] = '14-11-2023';
|
||||
$bb_cfg['tp_release_codename'] = 'Cattle';
|
||||
|
||||
|
@ -91,7 +91,7 @@ $bb_cfg['server_port'] = !empty($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT
|
|||
$bb_cfg['script_path'] = '/'; // The path where FORUM is located relative to the domain name
|
||||
|
||||
// GZip
|
||||
$bb_cfg['gzip_compress'] = false; // compress output
|
||||
$bb_cfg['gzip_compress'] = false; // Compress output
|
||||
|
||||
// Tracker
|
||||
$bb_cfg['announce_interval'] = 1800; // Announce interval (default: 1800)
|
||||
|
@ -138,10 +138,10 @@ $bb_cfg['dl_complete_days_keep'] = 180;
|
|||
$bb_cfg['dl_cancel_days_keep'] = 30;
|
||||
|
||||
// Tor-Stats
|
||||
$bb_cfg['torstat_days_keep'] = 60; // days to keep user's per-torrent stats
|
||||
$bb_cfg['torstat_days_keep'] = 60; // Days to keep user's per-torrent stats
|
||||
|
||||
// Tor-Help
|
||||
$bb_cfg['torhelp_enabled'] = false; // find dead torrents (without seeder) that user might help seeding
|
||||
$bb_cfg['torhelp_enabled'] = false; // Find dead torrents (without seeder) that user might help seeding
|
||||
|
||||
// URL's
|
||||
$bb_cfg['ajax_url'] = 'ajax.php'; # "http://{$_SERVER['SERVER_NAME']}/ajax.php"
|
||||
|
|
|
@ -321,6 +321,17 @@ function send_no_cache_headers()
|
|||
header('Pragma: no-cache');
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts "<br>" tags to "\n" line breaks
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
function br2nl(string $string): string
|
||||
{
|
||||
return preg_replace('#<br\s*/?>#i', "\n", $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds commas between every group of thousands
|
||||
*
|
||||
|
|
|
@ -145,7 +145,7 @@ class Ajax
|
|||
public function ajax_die(string $error_msg, int $error_code = E_AJAX_GENERAL_ERROR): void
|
||||
{
|
||||
$this->response['error_code'] = $error_code;
|
||||
$this->response['error_msg'] = strip_tags($error_msg);
|
||||
$this->response['error_msg'] = strip_tags(br2nl($error_msg));
|
||||
|
||||
// Get caller info
|
||||
if (!empty($_COOKIE['explain'])) {
|
||||
|
@ -258,7 +258,7 @@ class Ajax
|
|||
}
|
||||
|
||||
$this->response['prompt_confirm'] = 1;
|
||||
$this->response['confirm_msg'] = strip_tags($confirm_msg);
|
||||
$this->response['confirm_msg'] = strip_tags(br2nl($confirm_msg));
|
||||
$this->send();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue