Skip to content

Commit

Permalink
Merge 73634fa into 3231829
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj committed Jul 30, 2018
2 parents 3231829 + 73634fa commit 37b4f9c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/Bigcommerce/Api/Client.php
Expand Up @@ -406,7 +406,7 @@ private static function mapCount($object)
/**
* Swaps a temporary access code for a long expiry auth token.
*
* @param \stdClass $object
* @param \stdClass|array $object
* @return \stdClass
*/
public static function getAuthToken($object)
Expand All @@ -417,6 +417,12 @@ public static function getAuthToken($object)
return $connection->post(self::$login_url . '/oauth2/token', $context);
}

/**
* @param int $id
* @param string $redirectUrl
* @param string $requestIp
* @return string
*/
public static function getCustomerLoginToken($id, $redirectUrl = '', $requestIp = '')
{
if (empty(self::$client_secret)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Bigcommerce/Api/Connection.php
Expand Up @@ -98,8 +98,8 @@ public function __construct()
curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, array($this, 'parseHeader'));
curl_setopt($this->curl, CURLOPT_WRITEFUNCTION, array($this, 'parseBody'));

// Set to a blank string to make cURL include all encodings it can handle (gzip, deflate, identity) in the 'Accept-Encoding' request header and respect the 'Content-Encoding' response header
curl_setopt($this->curl, CURLOPT_ENCODING, '');
// Set to a blank string to make cURL include all encodings it can handle (gzip, deflate, identity) in the 'Accept-Encoding' request header and respect the 'Content-Encoding' response header
curl_setopt($this->curl, CURLOPT_ENCODING, '');

if (!ini_get("open_basedir")) {
curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);
Expand Down
2 changes: 2 additions & 0 deletions src/Bigcommerce/Api/Filter.php
Expand Up @@ -12,6 +12,8 @@ class Filter
/**
* Factory method, creates an instance of a filter.
* Used to build URLs to collection endpoints.
* @param array $filter
* @return $this
*/
public static function create($filter = array())
{
Expand Down
4 changes: 2 additions & 2 deletions src/Bigcommerce/Api/Resource.php
Expand Up @@ -100,11 +100,11 @@ private function isIgnoredField($field, $value)
return true;
}

if (strpos($field, "date") !== false && $value === "") {
if ($value === "" && strpos($field, "date") !== false) {
return true;
}

if (in_array($field, $this->ignoreIfZero, true) && $value === 0) {
if ($value === 0 && in_array($field, $this->ignoreIfZero, true)) {
return true;
}

Expand Down

0 comments on commit 37b4f9c

Please sign in to comment.