Bläddra i källkod

Merge branch 'hotfix/228'

Close #228
Matthew Weier O'Phinney 12 år sedan
förälder
incheckning
cdfe428b2c
1 ändrade filer med 6 tillägg och 1 borttagningar
  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) {