From e16cfa21fd71b28030e61dc8c8cf27a53d3151a2 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Thu, 22 Oct 2026 11:55:55 -0500 Subject: [PATCH] Require phpBB 3.3.19 and PHP 8.3.36 for extension enablement --- ext.php | 19 ++++++++++++------- language/en/install_topicclaim.php | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ext.php b/ext.php index 381a3b2..41a8b4f 100644 --- a/ext.php +++ b/ext.php @@ -19,13 +19,18 @@ class ext extends \phpbb\extension\base const NOTIFICATION_TYPE = 'phpbbmodders.topicclaim.notification.type.claim'; /** - * Refuse to enable below the minimum phpBB and PHP versions + * Check whether the extension can be enabled. + * The current phpBB and PHP version should meet or + * exceed the minimum version required by this extension: * - * @return bool|string True if enableable, otherwise the reason + * @return bool|array + * @access public */ public function is_enableable() { - if (!$this->check_phpbb_version() || !$this->check_php_version()) + $enableable = $this->check_phpbb_version() && $this->check_php_version(); + + if (!$enableable) { $language = $this->container->get('language'); $language->add_lang('install_topicclaim', 'phpbbmodders/topicclaim'); @@ -33,11 +38,11 @@ public function is_enableable() return $language->lang('TOPICCLAIM_NOT_ENABLEABLE'); } - return true; + return $enableable; } /** - * Require phpBB 3.3.19 + * Require phpBB 3.3.19 due to several security fixes in the phpBB software. * * @return bool */ @@ -47,13 +52,13 @@ public function check_phpbb_version() } /** - * Require PHP 7.4 + * Requires PHP 8.3.36 due to security fixes. * * @return bool */ public function check_php_version() { - return PHP_VERSION_ID >= 70400; + return PHP_VERSION_ID >= 80336; } /** diff --git a/language/en/install_topicclaim.php b/language/en/install_topicclaim.php index da0011c..f5f5c66 100644 --- a/language/en/install_topicclaim.php +++ b/language/en/install_topicclaim.php @@ -22,5 +22,5 @@ } $lang = array_merge($lang, [ - 'TOPICCLAIM_NOT_ENABLEABLE' => 'Topic Claim could not be enabled. It needs phpBB 3.3.19 or later and PHP 7.4.0 or later.', + 'TOPICCLAIM_NOT_ENABLEABLE' => 'Topic Claim could not be enabled. It needs phpBB 3.3.19 or later and PHP 8.3.36 or later.', ]);