$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) {
- return false;
- }
+ 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) {
+ return false;
+ }
- return true;
+ return true;
+ }
}
/**
$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;