mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #59179
[Bug 1824386] A change has been merged
Reviewed: https://reviews.mahara.org/11069
Committed: https://git.mahara.org/mahara/mahara/commit/042fb1c77daac5731154ed74882f3392a75415d3
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch: master
commit 042fb1c77daac5731154ed74882f3392a75415d3
Author: Cecilia Vela Gurovic <ceciliavg@xxxxxxxxxxxxxxx>
Date: Mon Jul 13 17:54:23 2020 +1200
Bug 1824386: Inappropriate comparison for DB versions
behatnotneeded
Change-Id: I1e5cfc165f2c2776305122606d2eeca208efc4ab
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1824386
Title:
Inappropriate comparison for DB versions
Status in Mahara:
Fix Committed
Bug description:
Relevant code from htdocs/init.php
if (is_postgres()) {
$okversion = '8.3';
$dbfriendlyname = 'PostgreSQL';
}
else if (is_mysql()) {
$okversion = '5.0.25';
$dbfriendlyname = 'MySQL';
}
if (floatval($dbversion['version']) < floatval($okversion)) {
throw new ConfigSanityException(get_string('dbversioncheckfailed', 'error', $dbfriendlyname, $dbversion['version'], $okversion));
}
floatval() on those strings will return, at best, the major version number, and while I think it's unlikely that people are going to be running 19.04 on PGSQL 8.2, right now the system wouldn't be able to detect that.
Switching out to version_compare would be a proper and safe comparison
for this.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1824386/+subscriptions
References