Skip to content

Commit

Permalink
fix binary trait mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
boxblinkracer committed Dec 23, 2023
1 parent 1117427 commit 534e6a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Traits/BinaryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ protected function binaryToString(string $binaryHex): string
*/
protected function stringToBinary(string $text): string
{
return (string)hex2bin($text);
$result = hex2bin($text);

if (!$result) {
return '';
}

return $result;
}

/**
Expand Down

0 comments on commit 534e6a1

Please sign in to comment.