Skip to content

Commit 0f08891

Browse files
HackwarBakual
authored andcommitted
[joomla#32179] Version comparison in installer is not future proof (Fix joomla#2146)
1 parent 523252d commit 0f08891

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

administrator/components/com_installer/views/database/tmpl/default.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
<li><?php echo JText::_('COM_INSTALLER_MSG_DATABASE_FILTER_ERROR'); ?>
4242
<?php endif; ?>
4343

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

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

administrator/components/com_installer/views/database/view.html.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ public function display($tpl = null)
4444
$this->pagination = $this->get('Pagination');
4545
$this->errorCount = count($this->errors);
4646

47-
if (!(strncmp($this->schemaVersion, JVERSION, 5) === 0))
47+
if (version_compare($this->schemaVersion, JVERSION) != 0)
4848
{
4949
$this->errorCount++;
5050
}
5151
if (!$this->filterParams)
5252
{
5353
$this->errorCount++;
5454
}
55-
if (($this->updateVersion != JVERSION))
55+
if (version_compare($this->updateVersion, JVERSION) != 0)
5656
{
5757
$this->errorCount++;
5858
}

0 commit comments

Comments
 (0)