mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 09:06:00 +00:00
Update isAvailable check to work for identical versions
Tika server reports it's version as "Apache Tika 1.7". Unfortunately, `version_compare` in PHP says that version "1.7" is less than version "1.7.0", meaning that Tika server was incorrectly being ruled out unless you used Tika server version 1.8 (where "1.8" > "1.7.0"). Changing the comparison string to just "1.7" means they match exactly, and therefore `version_compare` will return `0` rather than `-1`.
This commit is contained in:
parent
07c000dc0d
commit
21ed6e0f86
@ -86,7 +86,7 @@ class TikaServerTextExtractor extends FileTextExtractor
|
|||||||
{
|
{
|
||||||
return $this->getServerEndpoint()
|
return $this->getServerEndpoint()
|
||||||
&& $this->getClient()->isAvailable()
|
&& $this->getClient()->isAvailable()
|
||||||
&& version_compare($this->getVersion(), '1.7.0') >= 0;
|
&& version_compare($this->getVersion(), '1.7') >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user