Skip to content

Commit

Permalink
Remove UTF-8 encoding check in JWEBuilder (#554)
Browse files Browse the repository at this point in the history
The UTF-8 encoding validation for the payload in the JWEBuilder has been removed. This modification was necessary because the check was unnecessarily restrictive and caused issues in certain use-cases. Now, any string can be used as the payload without throwing an InvalidArgumentException.
  • Loading branch information
Spomky authored Apr 10, 2024
1 parent 570052b commit 8342de7
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/Library/Encryption/JWEBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ public function getCompressionMethodManager(): null|CompressionMethodManager
*/
public function withPayload(string $payload): self
{
if (mb_detect_encoding($payload, 'UTF-8', true) !== 'UTF-8') {
throw new InvalidArgumentException('The payload must be encoded in UTF-8');
}
$clone = clone $this;
$clone->payload = $payload;

Expand Down

0 comments on commit 8342de7

Please sign in to comment.