Skip to content

Commit

Permalink
[joomla#32179] Version comparison in installer is not future proof (Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored and Bakual committed May 12, 2014
1 parent 523252d commit 0f08891
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -41,11 +41,11 @@
<li><?php echo JText::_('COM_INSTALLER_MSG_DATABASE_FILTER_ERROR'); ?>
<?php endif; ?>

<?php if (!(strncmp($this->schemaVersion, JVERSION, 5) === 0)) : ?>
<?php if (version_compare($this->schemaVersion, JVERSION) != 0) : ?>
<li><?php echo JText::sprintf('COM_INSTALLER_MSG_DATABASE_SCHEMA_ERROR', $this->schemaVersion, JVERSION); ?></li>
<?php endif; ?>

<?php if (($this->updateVersion != JVERSION)) : ?>
<?php if (version_compare($this->updateVersion, JVERSION) != 0) : ?>
<li><?php echo JText::sprintf('COM_INSTALLER_MSG_DATABASE_UPDATEVERSION_ERROR', $this->updateVersion, JVERSION); ?></li>
<?php endif; ?>

Expand Down
Expand Up @@ -44,15 +44,15 @@ public function display($tpl = null)
$this->pagination = $this->get('Pagination');
$this->errorCount = count($this->errors);

if (!(strncmp($this->schemaVersion, JVERSION, 5) === 0))
if (version_compare($this->schemaVersion, JVERSION) != 0)
{
$this->errorCount++;
}
if (!$this->filterParams)
{
$this->errorCount++;
}
if (($this->updateVersion != JVERSION))
if (version_compare($this->updateVersion, JVERSION) != 0)
{
$this->errorCount++;
}
Expand Down

0 comments on commit 0f08891

Please sign in to comment.