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:
Ishan Jayamanne 2019-02-13 17:12:58 +13:00 committed by Robbie Averill
parent 07c000dc0d
commit 21ed6e0f86

View File

@ -86,7 +86,7 @@ class TikaServerTextExtractor extends FileTextExtractor
{
return $this->getServerEndpoint()
&& $this->getClient()->isAvailable()
&& version_compare($this->getVersion(), '1.7.0') >= 0;
&& version_compare($this->getVersion(), '1.7') >= 0;
}
/**