From 319c26227c569a71f857ddc1ca6d76eb6b304196 Mon Sep 17 00:00:00 2001 From: Andreu Correa Casablanca Date: Fri, 17 Feb 2017 15:41:15 +0100 Subject: [PATCH] Fix GUID::fromBase64String regex check --- src/GUID.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GUID.php b/src/GUID.php index 83427cd..94d507b 100644 --- a/src/GUID.php +++ b/src/GUID.php @@ -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'); }