diff --git a/README.md b/README.md index dc3dde9..5472f17 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See the [wiki](https://github.com/rosette-api/php/wiki) for more information. Installation ------------ -`composer require "rosette/api: ~1.0.1"` +`composer require "rosette/api: ~1.0.*"` Basic Usage ----------- diff --git a/composer.json b/composer.json index 1f28927..e21ddef 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "rosette/api", - "version": "1.0.1", + "version": "1.0.2", "description": "Rosette API PHP client SDK", "license": "Apache", "keywords": [ diff --git a/source/rosette/api/Api.php b/source/rosette/api/Api.php index b2026f6..96151f6 100644 --- a/source/rosette/api/Api.php +++ b/source/rosette/api/Api.php @@ -345,7 +345,7 @@ public function checkVersion($url, $versionToCheck = null) $resultObject = array_pop((array_slice($resultObject, -1))); $resultObject = (array) json_decode($resultObject); - if (key_exists('versionChecked', $resultObject) && $resultObject['versionChecked'] === true) { + if (array_key_exists('versionChecked', $resultObject) && $resultObject['versionChecked'] === true) { $this->version_checked = true; } else { throw new RosetteException( @@ -385,11 +385,11 @@ private function makeRequest($url, $headers, $data, $method) if ($this->useMultiPart === null) { $data = (array) $data; - if (key_exists('content', $data) && $data['content'] === "") { + if (array_key_exists('content', $data) && $data['content'] === "") { unset($data['content']); } - if (key_exists('contentUri', $data) && $data['contentUri'] === "") { + if (array_key_exists('contentUri', $data) && $data['contentUri'] === "") { unset($data['contentUri']); } @@ -430,7 +430,7 @@ private function makeRequest($url, $headers, $data, $method) $response = explode(PHP_EOL, $response); $this->setResponseCode($resCode); - if (count($response) > 8) { + if (array_key_exists(9, $response)) { if (strlen($response[9]) > 3 && mb_strpos($response[9], "\x1f" . "\x8b" . "\x08", 0) === 0) { // a gzipped string starts with ID1(\x1f) ID2(\x8b) CM(\x08) // http://www.gzip.org/zlib/rfc-gzip.html#member-format