diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d3ab6860..5c1107db6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ - Fixed null $u_data if user not found [\#783](https://github.com/torrentpier/torrentpier/pull/783) ([belomaxorka](https://github.com/belomaxorka)) - Added missing properties in User class [\#782](https://github.com/torrentpier/torrentpier/pull/782) ([belomaxorka](https://github.com/belomaxorka)) - Fixed some deprecations [\#777](https://github.com/torrentpier/torrentpier/pull/777) ([belomaxorka](https://github.com/belomaxorka)) -- Fixed: preg_match(): Passing null to parameter #2 [\#776](https://github.com/torrentpier/torrentpier/pull/776) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed: preg_match(): Passing null to parameter [\#776](https://github.com/torrentpier/torrentpier/pull/776) ([belomaxorka](https://github.com/belomaxorka)) - Reformated JS [\#770](https://github.com/torrentpier/torrentpier/pull/770), [\#794](https://github.com/torrentpier/torrentpier/pull/794) ([belomaxorka](https://github.com/belomaxorka)) - Implemented password_hash API 🥳 [\#768](https://github.com/torrentpier/torrentpier/pull/768) ([belomaxorka](https://github.com/belomaxorka)) - Updated deps [\#763](https://github.com/torrentpier/torrentpier/pull/763) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/common.php b/common.php index 6efd1b99a..fed7793a0 100644 --- a/common.php +++ b/common.php @@ -127,7 +127,7 @@ define('BOT_UID', -746); */ $DBS = new TorrentPier\Legacy\Dbs($bb_cfg); -function DB($db_alias = 'db') +function DB(string $db_alias = 'db') { global $DBS; return $DBS->get_db_obj($db_alias); @@ -138,7 +138,7 @@ function DB($db_alias = 'db') */ $CACHES = new TorrentPier\Legacy\Caches($bb_cfg); -function CACHE($cache_name) +function CACHE(string $cache_name) { global $CACHES; return $CACHES->get_cache_obj($cache_name); diff --git a/library/config.php b/library/config.php index c96d1ada1..5f5039070 100644 --- a/library/config.php +++ b/library/config.php @@ -14,7 +14,7 @@ if (!defined('BB_ROOT')) { // Server settings $domain_name = 'torrentpier.com'; // enter here your primary domain name of your site $domain_name = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $domain_name; -$domain_ssl = false; +$force_ssl = false; $bb_cfg = []; @@ -354,7 +354,7 @@ $bb_cfg['show_sidebar2_on_every_page'] = false; // Cookie $bb_cfg['cookie_domain'] = in_array($domain_name, [$_SERVER['SERVER_ADDR'], 'localhost'], true) ? '' : ".$domain_name"; -$bb_cfg['cookie_secure'] = $domain_ssl ? true : \TorrentPier\Helpers\IsHelper::isHTTPS(); +$bb_cfg['cookie_secure'] = $force_ssl || \TorrentPier\Helpers\IsHelper::isHTTPS(); $bb_cfg['cookie_prefix'] = 'bb_'; // 'bb_' $bb_cfg['cookie_same_site'] = 'Lax'; // Lax, None, Strict | https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite