From 08440a0d032e86c51abcda4f0fae829a10d3a32d Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 8 Apr 2023 14:46:50 +0700 Subject: [PATCH] Minor fixes (#142) --- CHANGELOG.md | 2 +- library/includes/core/dbs.php | 6 ++---- library/includes/init_bb.php | 5 +++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 733be5cf..259bf78e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ - Enhanced https check [\#131](https://github.com/torrentpier/torrentpier-lts/pull/131), [\#132](https://github.com/torrentpier/torrentpier-lts/pull/132) ([belomaxorka](https://github.com/belomaxorka)) - Added ability to configure sphinx debug [\#137](https://github.com/torrentpier/torrentpier-lts/pull/137) ([belomaxorka](https://github.com/belomaxorka)) - Redundant pagination, mysql 5.7+ issue [\#140](https://github.com/torrentpier/torrentpier-lts/pull/140) ([belomaxorka](https://github.com/belomaxorka)) -- Minor fixes [\#124](https://github.com/torrentpier/torrentpier-lts/pull/124), [\#133](https://github.com/torrentpier/torrentpier-lts/pull/133), [\#135](https://github.com/torrentpier/torrentpier-lts/pull/135), [\#136](https://github.com/torrentpier/torrentpier-lts/pull/136), [\#139](https://github.com/torrentpier/torrentpier-lts/pull/139) ([belomaxorka](https://github.com/belomaxorka)) +- Minor fixes [\#124](https://github.com/torrentpier/torrentpier-lts/pull/124), [\#133](https://github.com/torrentpier/torrentpier-lts/pull/133), [\#135](https://github.com/torrentpier/torrentpier-lts/pull/135), [\#136](https://github.com/torrentpier/torrentpier-lts/pull/136), [\#139](https://github.com/torrentpier/torrentpier-lts/pull/139), [\#142](https://github.com/torrentpier/torrentpier-lts/pull/142) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.1.5-2023.03](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.03) (2023-04-04) [Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.03...main) diff --git a/library/includes/core/dbs.php b/library/includes/core/dbs.php index a3e9ef91..b4d37920 100644 --- a/library/includes/core/dbs.php +++ b/library/includes/core/dbs.php @@ -41,6 +41,8 @@ class DBS // определение имени сервера function get_srv_name ($name) { + $srv_name = 'db1'; + if (isset($this->alias[$name])) { $srv_name = $this->alias[$name]; @@ -49,10 +51,6 @@ class DBS { $srv_name = $name; } - else - { - $srv_name = 'db1'; - } return $srv_name; } } \ No newline at end of file diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 40685cd8..12356393 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -12,7 +12,7 @@ $gen_simple_header = false; $user = null; // Obtain and encode user IP -$client_ip = !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1'; +$client_ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1'; $user_ip = encode_ip($client_ip); define('CLIENT_IP', $client_ip); define('USER_IP', $user_ip); @@ -193,6 +193,7 @@ define('TOR_TMP', 10); // временная define('TOR_PREMOD', 11); // премодерация define('TOR_REPLENISH', 12); // пополняемая +// Иконки статусов $bb_cfg['tor_icons'] = array( TOR_NOT_APPROVED => '*', TOR_CLOSED => 'x', @@ -543,7 +544,7 @@ function cron_release_file_lock () function cron_touch_lock_file ($lock_file) { - file_write(make_rand_str(20), $lock_file, 0, true, true); + file_write('', $lock_file, 0, true, true); } function cron_enable_board ()