Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,30 @@
class ext extends \phpbb\extension\base
{
/**
* 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_copylinks', 'phpbbmodders/copylinks');

return $language->lang('COPYLINKS_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
*/
Expand All @@ -44,12 +49,12 @@ 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;
}
}
2 changes: 1 addition & 1 deletion language/en/install_copylinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
}

$lang = array_merge($lang, [
'COPYLINKS_NOT_ENABLEABLE' => 'Copy Links needs phpBB 3.3.19 or newer and PHP 7.4 or newer.',
'COPYLINKS_NOT_ENABLEABLE' => 'Copy Links needs phpBB 3.3.19 or newer and PHP 8.3.36 or newer.',
]);
Loading