diff --git a/ext.php b/ext.php new file mode 100644 index 0000000..dfe8845 --- /dev/null +++ b/ext.php @@ -0,0 +1,54 @@ +check_phpbb_version() && $this->check_php_version(); + + if (!$enableable) + { + $language = $this->container->get('language'); + $language->add_lang('topicdescription_install', 'rmcgirr83/topicdescription'); + + return $language->lang('TOPICDESCRIPTION_NOT_ENABLEABLE'); + } + + return $enableable; + } + + /** + * Require phpBB 3.3.19 due to several security fixes in the phpBB software. + * + * @return bool + */ + protected function check_phpbb_version() + { + return phpbb_version_compare(PHPBB_VERSION, '3.3.19', '>='); + } + + /** + * Requires PHP 8.3.36 due to security fixes. + * + * @return bool + */ + protected function check_php_version() + { + return PHP_VERSION_ID >= 80336; + } +} diff --git a/language/en/topicdescription_install.php b/language/en/topicdescription_install.php new file mode 100644 index 0000000..aa7c730 --- /dev/null +++ b/language/en/topicdescription_install.php @@ -0,0 +1,20 @@ + 'Topic Description could not be enabled. It requires phpBB 3.3.19 or later and PHP 8.3.36 or later.', +));