Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Fix UTF-8 string issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JValck committed Mar 18, 2018
1 parent ff617a0 commit a194008
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/UuidBinaryModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function deepArray($array)
elseif (is_object($value) && method_exists($value, 'toArray')) {
$array[$key] = $value->toArray();
}
elseif (is_string($value) && !ctype_print($value)) {
elseif (is_string($value) && mb_detect_encoding($value) === false) {//mb_detect_encoding will return false if $value is a binary type
$array[$key] = $useOptimization ? self::toNormal($value) : bin2hex($value);
}
}
Expand Down

0 comments on commit a194008

Please sign in to comment.