From 5cc6aec6a0842b086c815393ff1b636d2921b9d3 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 9 Apr 2023 13:44:34 +0700 Subject: [PATCH] Minor fixes --- CHANGELOG.md | 2 +- common.php | 7 +++++++ library/config.php | 7 ------- library/includes/init_bb.php | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5afdb4f..61cbc876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ - 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)) - Added Freeleech [\#143](https://github.com/torrentpier/torrentpier-lts/pull/143) ([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), [\#144](https://github.com/torrentpier/torrentpier-lts/pull/144) ([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), [\#144](https://github.com/torrentpier/torrentpier-lts/pull/144), [\#145](https://github.com/torrentpier/torrentpier-lts/pull/145) ([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/common.php b/common.php index 8cccd6f0..9738720c 100644 --- a/common.php +++ b/common.php @@ -12,11 +12,18 @@ if (empty($_SERVER['SERVER_NAME'])) $_SERVER['SERVER_NAME'] = ''; if (!defined('BB_ROOT')) define('BB_ROOT', './'); +if (!defined('BB_SCRIPT')) define('BB_SCRIPT', 'undefined'); if (!defined('IN_FORUM') && !defined('IN_TRACKER')) define('IN_FORUM', true); header('X-Frame-Options: SAMEORIGIN'); header('X-Powered-By: TorrentPier LTS'); +// Cloudflare +if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) +{ + $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; +} + // Get initial config require(BB_ROOT . 'library/config.php'); diff --git a/library/config.php b/library/config.php index cadf2ff2..5a4191a0 100644 --- a/library/config.php +++ b/library/config.php @@ -12,7 +12,6 @@ - Config - Datastore * Server - - Cloudflare - GZip * Tracker * Ocelot @@ -141,12 +140,6 @@ $bb_cfg['server_port'] = (!empty($_SERVER['SERVER_PORT'])) ? $_SERVER['SERVER_PORT'] : 80; // The port your server is running on $bb_cfg['script_path'] = '/'; // The path where FORUM is located relative to the domain name -// Cloudflare -if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) -{ - $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; -} - // GZip $bb_cfg['gzip_compress'] = true; // compress output diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 12356393..3bbac2b3 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -2,7 +2,6 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); if (!(PHP_VERSION_ID >= 50303)) die('TorrentPier II requires PHP version 5.3.3+. Your PHP version '. PHP_VERSION); -if (!defined('BB_SCRIPT')) define('BB_SCRIPT', 'undefined'); if (!defined('BB_CFG_LOADED')) trigger_error('File config.php not loaded', E_USER_ERROR); // Define some basic configuration arrays