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

Commit

Permalink
Fix GUID::fromBase64String regex check
Browse files Browse the repository at this point in the history
  • Loading branch information
castarco authored Feb 17, 2017
1 parent 49c361f commit 319c262
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GUID.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function fromHexString(string $hexStr, int $expectedLength = self:

public static function fromBase64String(string $b64Str, int $expectedLength = self::DEFAULT_GUID_SIZE): GUID
{
if (0 === \preg_match('^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$', $b64Str)) {
if (0 === \preg_match('#^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$#', $b64Str)) {
throw new UnserializationError('Invalid base64 string');
}

Expand Down

0 comments on commit 319c262

Please sign in to comment.