Ensure that only strings get encoded
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 19 Oct 2016 23:35:12 +0000 (10:35 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 19 Oct 2016 23:35:51 +0000 (10:35 +1100)
CRM/Utils/Array.php

index 8537409d36ca0fd6f470f308d01f0ec07dc71eb9..d82250cc7460e65a837befe2296fd7560f6f48d0 100644 (file)
@@ -1088,9 +1088,12 @@ class CRM_Utils_Array {
       if (is_array($value)) {
         $array[$key] = self::encode_items($value);
       }
-      else {
+      elseif (is_string($value)) {
         $array[$key] = mb_convert_encoding($value, mb_detect_encoding($value, mb_detect_order(), TRUE), 'UTF-8');
       }
+      else {
+        $array[$key] = $value;
+      }
     }
     return $array;
   }