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

Commit

Permalink
Merge pull request alsofronie#38 from JValck/master
Browse files Browse the repository at this point in the history
Fix UTF-8 string issues
  • Loading branch information
alsofronie authored Mar 19, 2018
2 parents ff617a0 + a194008 commit 7edc731
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 7edc731

Please sign in to comment.