mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Minor improvements (#882)
* Minor improvements * Updated * Updated * Updated * Update privmsg.php * Updated * Update admin_attach_cp.php
This commit is contained in:
parent
2c07660435
commit
4b453de64a
75 changed files with 699 additions and 735 deletions
|
@ -91,7 +91,7 @@ if (file_exists(BB_PATH . '/library/config.local.php')) {
|
|||
* Server variables initialize
|
||||
*/
|
||||
$server_protocol = $bb_cfg['cookie_secure'] ? 'https://' : 'http://';
|
||||
$server_port = in_array((int)$bb_cfg['server_port'], array(80, 443), true) ? '' : ':' . $bb_cfg['server_port'];
|
||||
$server_port = in_array((int)$bb_cfg['server_port'], [80, 443], true) ? '' : ':' . $bb_cfg['server_port'];
|
||||
define('FORUM_PATH', $bb_cfg['script_path']);
|
||||
define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']);
|
||||
unset($server_protocol, $server_port);
|
||||
|
@ -152,11 +152,11 @@ switch ($bb_cfg['datastore_type']) {
|
|||
break;
|
||||
|
||||
case 'sqlite':
|
||||
$default_cfg = array(
|
||||
$default_cfg = [
|
||||
'db_file_path' => $bb_cfg['cache']['db_dir'] . 'datastore.sqlite.db',
|
||||
'pconnect' => true,
|
||||
'con_required' => true,
|
||||
);
|
||||
];
|
||||
$datastore = new TorrentPier\Legacy\Datastore\Sqlite($default_cfg, $bb_cfg['cache']['prefix']);
|
||||
break;
|
||||
|
||||
|
@ -265,7 +265,7 @@ function verify_id($id, $length): bool
|
|||
|
||||
function clean_filename($fname)
|
||||
{
|
||||
static $s = array('\\', '/', ':', '*', '?', '"', '<', '>', '|', ' ');
|
||||
static $s = ['\\', '/', ':', '*', '?', '"', '<', '>', '|', ' '];
|
||||
return str_replace($s, '_', str_compact($fname));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue