From 58bfce942d86e4d11e2a5c9bf5ab45490ba882d7 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 17 Sep 2023 01:16:52 +0700 Subject: [PATCH] Minor improvements (#244) * Minor improvements * Update CHANGELOG.md --- CHANGELOG.md | 2 +- library/includes/functions.php | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39b11a65..aeaa48c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ **Merged pull requests:** - Release v2.1.5-2023.09 🎉 -- Minor improvements [\#235](https://github.com/torrentpier/torrentpier-lts/pull/235), [\#236](https://github.com/torrentpier/torrentpier-lts/pull/236), [\#237](https://github.com/torrentpier/torrentpier-lts/pull/237), [\#238](https://github.com/torrentpier/torrentpier-lts/pull/238), [\#239](https://github.com/torrentpier/torrentpier-lts/pull/239), [\#240](https://github.com/torrentpier/torrentpier-lts/pull/240), [\#241](https://github.com/torrentpier/torrentpier-lts/pull/241), [\#242](https://github.com/torrentpier/torrentpier-lts/pull/242), [\#243](https://github.com/torrentpier/torrentpier-lts/pull/243) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#235](https://github.com/torrentpier/torrentpier-lts/pull/235), [\#236](https://github.com/torrentpier/torrentpier-lts/pull/236), [\#237](https://github.com/torrentpier/torrentpier-lts/pull/237), [\#238](https://github.com/torrentpier/torrentpier-lts/pull/238), [\#239](https://github.com/torrentpier/torrentpier-lts/pull/239), [\#240](https://github.com/torrentpier/torrentpier-lts/pull/240), [\#241](https://github.com/torrentpier/torrentpier-lts/pull/241), [\#242](https://github.com/torrentpier/torrentpier-lts/pull/242), [\#243](https://github.com/torrentpier/torrentpier-lts/pull/243), [\#244](https://github.com/torrentpier/torrentpier-lts/pull/244) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.1.5-2023.08](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.08) (2023-09-04) [Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.07...v2.1.5-2023.08) diff --git a/library/includes/functions.php b/library/includes/functions.php index 225b7cd1..f1ea89f6 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -2817,22 +2817,21 @@ function bb_captcha ($mode, $callback = '') { global $bb_cfg, $lang; - require_once(CLASS_DIR .'recaptcha.php'); - $secret = $bb_cfg['captcha']['secret_key']; $public = $bb_cfg['captcha']['public_key']; $theme = isset($bb_cfg['captcha']['theme']) ? $bb_cfg['captcha']['theme'] : 'light'; + if (!$bb_cfg['captcha']['disabled'] && (!$public || !$secret)) + { + bb_die($lang['CAPTCHA_SETTINGS']); + } + + require_once(CLASS_DIR .'recaptcha.php'); $reCaptcha = new ReCaptcha($secret); switch ($mode) { case 'get': - if (!$public || !$secret) - { - bb_die($lang['CAPTCHA_SETTINGS']); - } - return "