We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d068fa1 commit 71929caCopy full SHA for 71929ca
src/Utils/Binary.php
@@ -117,7 +117,11 @@ public function __construct(mixed $payload = null)
117
$this->bytes = [];
118
break;
119
case is_numeric($payload):
120
- $this->bytes = [(int)$payload];
+ $byte = (int)$payload;
121
+ if ($byte < 0 || $byte > 255) {
122
+ throw new InvalidArgumentException("Payload numeric '$payload' is invalid", ExceptionCode::ERROR_TYPE);
123
+ }
124
+ $this->bytes = [];
125
126
case is_string($payload):
127
$this->bytes = static::StringToBytes($payload);
0 commit comments