From a3059278ee50ea2e31d9b79228db9e7c00284cf9 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_postingtemplate.php | 44 ++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 ext.php create mode 100644 language/en/install_postingtemplate.php diff --git a/ext.php b/ext.php new file mode 100644 index 0000000..318bb7d --- /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_postingtemplate', 'phpbbmodders/postingtemplate'); + + return $language->lang('POSTINGTEMPLATE_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_postingtemplate.php b/language/en/install_postingtemplate.php new file mode 100644 index 0000000..3146547 --- /dev/null +++ b/language/en/install_postingtemplate.php @@ -0,0 +1,44 @@ + 'Posting Template could not be enabled. The minimum requirements of phpBB 3.3.19 and/or PHP 7.4.0 were not satisfied.', +]);