TickTackk
Well-known member
- Affected version
- 2.1.9
In file
should be:
Or else when the required PHP version is set to
Edit: this might also apply to PHP extension versions or MySQL.
src\XF\AddOn\Manager.php
PHP:
if (strpos($productKey, 'php-ext/') === 0)
{
$parts = explode('/', $productKey, 2);
if (isset($parts[1]))
{
$enabled = extension_loaded($parts[1]);
if ($version === '*')
{
$versionValid = true;
}
else
{
$versionValid = (version_compare(phpversion($parts[1]), $version) === 1);
}
}
}
else if ($productKey === 'php')
{
$enabled = true;
$versionValid = (version_compare(phpversion(), $version) === 1);
}
else if ($productKey === 'mysql')
{
$mySqlVersion = \XF::db()->getServerVersion();
if ($mySqlVersion)
{
$enabled = true;
$versionValid = (version_compare(strtolower($mySqlVersion), $version) === 1);
}
}
PHP:
if (strpos($productKey, 'php-ext/') === 0)
{
$parts = explode('/', $productKey, 2);
if (isset($parts[1]))
{
$enabled = extension_loaded($parts[1]);
if ($version === '*')
{
$versionValid = true;
}
else
{
$versionValid = \version_compare(phpversion($parts[1]), $version, 'ge');
}
}
}
else if ($productKey === 'php')
{
$enabled = true;
$versionValid = \version_compare(phpversion(), $version, 'ge');
}
else if ($productKey === 'mysql')
{
$mySqlVersion = \XF::db()->getServerVersion();
if ($mySqlVersion)
{
$enabled = true;
$versionValid = \version_compare(strtolower($mySqlVersion), $version, 'ge');
}
}
7.2.29
and the installed PHP version is 7.2.29
, XF will not allow installing the add-on.Edit: this might also apply to PHP extension versions or MySQL.