Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{
"name" : "zohocrm/php-sdk",
"name" : "templatemonster/zohocrm-php-sdk",
"description" : "Zoho CRM API SDK for PHP",
"type" : "sdk",
"homepage": "https://github.com/zoho/zohocrm-php-sdk",
"homepage": "https://github.com/Plasma-Platform/zohocrm-php-sdk",
"authors" : [
{
"name" : "Zoho CRM API Team",
"email" : "[email protected]",
"homepage" : "https://www.zoho.com/crm/help/customer-support.html",
"role" : "Developer"
},
{
"name" : "Pavlo Titkov",
"email" : "[email protected]",
"role" : "Developer"
}
],
"require" : {
"php" : ">=7.0",
"ext-json" : "*",
"ext-curl" : "*"
"ext-curl" : "*",
"ext-curl" : "*",
"ext-mbstring": "*"
},
"require-dev" : {
"phpunit/phpunit" : ">=5.7"
Expand Down
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/Initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ private function getEncodedKey($user, $environment)

$key = explode("@", $userMail)[0] . $environment->getUrl();

$input = unpack('C*', utf8_encode($key));
$input = unpack('C*', mb_convert_encoding($key, 'UTF-8'));

return base64_encode(implode(array_map("chr", $input)));
}
Expand Down
4 changes: 2 additions & 2 deletions src/com/zoho/crm/api/exception/SDKException.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($code, $message, $details=null, \Exception $cause=nu
$this->_message = $cause->getMessage();
}

parent::__construct($message);
parent::__construct(is_null($message) ? "" : $message);
}

/**
Expand Down Expand Up @@ -99,4 +99,4 @@ public function __toString()

return $returnMsg;
}
}
}
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/util/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function getEncodedFileName()

$fileName = explode("@",$fileName)[0] . Initializer::getInitializer()->getEnvironment()->getUrl();

$input = unpack('C*', utf8_encode($fileName));
$input = unpack('C*', mb_convert_encoding($fileName, 'UTF-8'));

$str = base64_encode(implode(array_map("chr", $input)));

Expand Down
20 changes: 10 additions & 10 deletions src/com/zoho/crm/api/util/FormDataConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public function appendToRequest(&$requestBase, $requestObject)

$date = new \DateTime();

$data = utf8_encode($lineEnd);
$data = mb_convert_encoding($lineEnd, 'UTF-8');

$current_time_long = $date->getTimestamp();

$boundaryStart = utf8_encode($hypen.(string)$current_time_long.$lineEnd);
$boundaryStart = mb_convert_encoding($hypen.(string)$current_time_long.$lineEnd, 'UTF-8');

for ($i = 0; $i < sizeof($keysDetail); $i++)
{
Expand All @@ -129,14 +129,14 @@ public function appendToRequest(&$requestBase, $requestObject)

$contentDisp = "Content-Disposition: form-data; name=\"".$key."\";filename=\"".$fileName."\"".$lineEnd.$lineEnd;

$data = $data.utf8_encode($contentDisp);
$data = $data.mb_convert_encoding($contentDisp, 'UTF-8');

$data = $data.$fileData.utf8_encode($lineEnd);
$data = $data.$fileData.mb_convert_encoding($lineEnd, 'UTF-8');
}
}
$boundaryend = $hypen . (string)$current_time_long . $hypen . $lineEnd . $lineEnd;

$data = $data . utf8_encode($boundaryend);
$data = $data . mb_convert_encoding($boundaryend, 'UTF-8');

$header = ['ENCTYPE: multipart/form-data','Content-Type:multipart/form-data;boundary=' . (string)$current_time_long];

Expand All @@ -160,19 +160,19 @@ public function appendToRequest(&$requestBase, $requestObject)

$header = ['ENCTYPE: multipart/form-data','Content-Type:multipart/form-data;boundary='.(string)$current_time_long];

$data = utf8_encode($lineEnd);
$data = mb_convert_encoding($lineEnd, 'UTF-8');

$boundaryStart = utf8_encode($hypen.(string)$current_time_long.$lineEnd) ;
$boundaryStart = mb_convert_encoding($hypen.(string)$current_time_long.$lineEnd, 'UTF-8') ;

$data = $data.$boundaryStart;

$data = $data.utf8_encode($contentDisp);
$data = $data.mb_convert_encoding($contentDisp, 'UTF-8');

$data = $data.$fileData.utf8_encode($lineEnd);
$data = $data.$fileData.mb_convert_encoding($lineEnd, 'UTF-8');

$boundaryend = $hypen.(string)$current_time_long.$hypen.$lineEnd.$lineEnd;

$data = $data.utf8_encode($boundaryend);
$data = $data.mb_convert_encoding($boundaryend, 'UTF-8');

$requestBase[CURLOPT_HTTPHEADER] = $header;

Expand Down
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/util/ModuleFieldsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private static function getFileName()

$fileName = explode("@", $fileName)[0] . Initializer::getInitializer()->getEnvironment()->getUrl();

$input = unpack('C*', utf8_encode($fileName));
$input = unpack('C*', mb_convert_encoding($fileName, 'UTF-8'));

return base64_encode(implode(array_map("chr", $input)));
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/util/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private static function getFileName()

$fileName = explode("@", $fileName)[0] . Initializer::getInitializer()->getEnvironment()->getUrl();

$input = unpack('C*', utf8_encode($fileName));
$input = unpack('C*', mb_convert_encoding($fileName, 'UTF-8'));

$str = base64_encode(implode(array_map("chr", $input)));

Expand Down