Skip to content

Commit

Permalink
Stop installation if minimum requirement isn't met. (#15890)
Browse files Browse the repository at this point in the history
The specified minimum version is a valid version.
  • Loading branch information
Thomas Hunziker authored and wilsonge committed May 29, 2017
1 parent cde023f commit 8ec4b68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/cms/installer/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,19 @@ class JInstallerScript
public function preflight($type, $parent)
{
// Check for the minimum PHP version before continuing
if (!empty($this->minimumPhp) && !version_compare(PHP_VERSION, $this->minimumPhp, '>'))
if (!empty($this->minimumPhp) && version_compare(PHP_VERSION, $this->minimumPhp, '<'))
{
JLog::add(JText::sprintf('JLIB_INSTALLER_MINIMUM_PHP', $this->minimumPhp), JLog::WARNING, 'jerror');

return false;
}

// Check for the minimum Joomla version before continuing
if (!empty($this->minimumJoomla) && !version_compare(JVERSION, $this->minimumJoomla, '>'))
if (!empty($this->minimumJoomla) && version_compare(JVERSION, $this->minimumJoomla, '<'))
{
JLog::add(JText::sprintf('JLIB_INSTALLER_MINIMUM_JOOMLA', $this->minimumJoomla), JLog::WARNING, 'jerror');

return false;
}

// Extension manifest file version
Expand Down

0 comments on commit 8ec4b68

Please sign in to comment.