From fe52b27c0f1055446a5c4bfb8bcc3b4d51d92b8d Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Mon, 5 Oct 2026 09:20:38 -0500 Subject: [PATCH] Require phpBB 3.3.19 Refuse to enable on phpBB older than 3.3.19 or below the extension's minimum PHP version, showing a clear reason instead of a generic error. phpBB 3.3.17 through 3.3.19 fixed a series of security issues, so older boards should update phpBB first. Co-Authored-By: Claude Opus 5.5 --- ext.php | 62 +++++++++++++++++++++++++++ language/en/install_groupswitches.php | 44 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 ext.php create mode 100644 language/en/install_groupswitches.php diff --git a/ext.php b/ext.php new file mode 100644 index 0000000..37fce91 --- /dev/null +++ b/ext.php @@ -0,0 +1,62 @@ +check_phpbb_version() && $this->check_php_version(); + + if (!$enableable) + { + $language = $this->container->get('language'); + $language->add_lang('install_groupswitches', 'phpbbmodders/groupswitches'); + + return $language->lang('GROUPSWITCHES_NOT_ENABLEABLE'); + } + + return $enableable; + } + + /** + * Require phpBB 3.3.19 + * + * @return bool + */ + public function check_phpbb_version() + { + return phpbb_version_compare(PHPBB_VERSION, '3.3.19', '>='); + } + + /** + * Require PHP 7.4 + * + * @return bool + */ + public function check_php_version() + { + return PHP_VERSION_ID >= 70400; + } +} diff --git a/language/en/install_groupswitches.php b/language/en/install_groupswitches.php new file mode 100644 index 0000000..1d86f76 --- /dev/null +++ b/language/en/install_groupswitches.php @@ -0,0 +1,44 @@ + 'Group Switches could not be enabled. The minimum requirements of phpBB 3.3.19 and/or PHP 7.4.0 were not satisfied.', +]);