From 41db8798afc51494e768fd58e841604fd3c756f9 Mon Sep 17 00:00:00 2001 From: who Date: Mon, 13 Apr 2015 12:22:38 -0700 Subject: [PATCH] correct usage of strpos --- .../swagger-codegen/src/main/resources/php/APIClient.mustache | 2 +- modules/swagger-codegen/src/main/resources/php/api.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache index c6bc45bc6a..b12921d776 100644 --- a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache @@ -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)); } diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 6acb2e8743..1267f76d35 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -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); }