浏览代码

Merge branch 'hotfix/228'

Close #228
Matthew Weier O'Phinney 12 年之前
父节点
当前提交
cdfe428b2c
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      library/Zend/Mobile/Push/Apns.php

+ 6 - 1
library/Zend/Mobile/Push/Apns.php

@@ -310,7 +310,12 @@ class Zend_Mobile_Push_Apns extends Zend_Mobile_Push_Abstract
         foreach($message->getCustomData() as $k => $v) {
             $payload[$k] = $v;
         }
-        $payload = json_encode($payload);
+        
+        if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
+            $payload = json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
+        } else {
+            $payload = json_encode($payload);
+        }
 
         $expire = $message->getExpire();
         if ($expire > 0) {