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

Commit

Permalink
use strict ASCII mode for detecting binary strings
Browse files Browse the repository at this point in the history
  • Loading branch information
alsofronie committed Dec 11, 2019
1 parent 339cb57 commit 19302d1
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) && mb_detect_encoding($value) === false) {//mb_detect_encoding will return false if $value is a binary type
elseif (is_string($value) && mb_detect_encoding($value, 'ASCII', true) === 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 19302d1

Please sign in to comment.