mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-54948 core_upgrade: fix unoconv check on the environment page
This commit is contained in:
parent
9254ba09e8
commit
6937d89be6
@ -2297,13 +2297,19 @@ function check_unoconv_version(environment_results $result) {
|
||||
$unoconvbin = \escapeshellarg($CFG->pathtounoconv);
|
||||
$command = "$unoconvbin --version";
|
||||
exec($command, $output);
|
||||
preg_match('/([0-9]+\.[0-9]+)/', $output[0], $matches);
|
||||
$currentversion = (float)$matches[0];
|
||||
$supportedversion = 0.7;
|
||||
if ($currentversion < $supportedversion) {
|
||||
$result->setInfo('unoconv version not supported');
|
||||
$result->setStatus(false);
|
||||
return $result;
|
||||
if ($output) {
|
||||
$currentversion = 0;
|
||||
foreach ($output as $response) {
|
||||
if (preg_match('/unoconv (\\d+\\.\\d+)/', $response, $matches)) {
|
||||
$currentversion = (float)$matches[1];
|
||||
}
|
||||
}
|
||||
$supportedversion = 0.7;
|
||||
if ($currentversion < $supportedversion) {
|
||||
$result->setInfo('unoconv version not supported');
|
||||
$result->setStatus(false);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user