Inappropriate comparison for DB versions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Cecilia Vela Gurovic |
Bug Description
Relevant code from htdocs/init.php
if (is_postgres()) {
$okversion = '8.3';
}
else if (is_mysql()) {
$okversion = '5.0.25';
}
if (floatval(
throw new ConfigSanityExc
}
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.
Changed in mahara: | |
assignee: | nobody → Cecilia Vela Gurovic (ceciliavg) |
importance: | Undecided → Medium |
importance: | Medium → Undecided |
status: | New → In Progress |
Changed in mahara: | |
milestone: | none → 20.10.0 |
importance: | Undecided → Medium |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Patch for "master" branch: https:/ /reviews. mahara. org/11069