mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
Ensure that the version number has a major, minor and patch number
This commit is contained in:
parent
9f04583ed5
commit
4429acb6ec
@ -70,9 +70,17 @@ class TikaServerTextExtractor extends FileTextExtractor
|
|||||||
|
|
||||||
public function isAvailable()
|
public function isAvailable()
|
||||||
{
|
{
|
||||||
|
$version = $this->getVersion();
|
||||||
|
// ensure that the version number has a major, minor and patch number
|
||||||
|
// reason being that version_compare('1.7', '1.7.0') will return -1 instead of 0
|
||||||
|
for ($i = 0; $i < 2; $i++) {
|
||||||
|
if (substr_count($version, '.') < 2) {
|
||||||
|
$version .= '.0';
|
||||||
|
}
|
||||||
|
}
|
||||||
return $this->getServerEndpoint() &&
|
return $this->getServerEndpoint() &&
|
||||||
$this->getClient()->isAvailable() &&
|
$this->getClient()->isAvailable() &&
|
||||||
version_compare($this->getVersion(), '1.7.0') >= 0;
|
version_compare($version, '1.7.0') >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsExtension($extension)
|
public function supportsExtension($extension)
|
||||||
|
Loading…
Reference in New Issue
Block a user