Merge pull request #629 from who/develop_2.0

Correct usage of strpos in PHP APIClient mustache template
This commit is contained in:
Tony Tam 2015-04-13 12:30:41 -07:00
commit 444666a365
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class APIClient {
$headers[] = $this->headerName . ": " . $this->headerValue;
}
if ((isset($headers['Content-Type']) and strpos($headers['Content-Type'], "multipart/form-data") < 0) and (is_object($postData) or is_array($postData))) {
if ((isset($headers['Content-Type']) and strpos($headers['Content-Type'], "multipart/form-data") === FALSE) and (is_object($postData) or is_array($postData))) {
$postData = json_encode($this->sanitizeForSerialization($postData));
}

View File

@ -84,7 +84,7 @@ class {{classname}} {
}
// for HTTP post (form)
if (strpos($headerParams['Content-Type'], "application/x-www-form-urlencoded") > -1) {
if (strpos($headerParams['Content-Type'], "application/x-www-form-urlencoded") !== FALSE) {
$httpBody = http_build_query($formParams);
}