Skip to content

Commit

Permalink
Update Message.php
Browse files Browse the repository at this point in the history
Fix string length issue for unicode payloads. Ref zendframework#8 (comment)
  • Loading branch information
maciekish committed Dec 4, 2013
1 parent e27de55 commit b4bfe38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/ZendService/Apple/Apns/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function getPayloadJson()
// don't escape utf8 payloads unless json_encode does not exist.
if (defined('JSON_UNESCAPED_UNICODE') && function_exists('mb_strlen')) {
$payload = json_encode($payload, JSON_UNESCAPED_UNICODE);
$length = mb_strlen($payload, 'UTF-8');
$length = strlen($payload);
} else {
$payload = JsonEncoder::encode($payload);
$length = strlen($payload);
Expand Down

0 comments on commit b4bfe38

Please sign in to comment.