From e6627ccb520fd02df4513066f095fb3cedb546b9 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sun, 20 Aug 2023 20:20:56 +0800 Subject: [PATCH] gen_stub: fix regexps with unintentional range due to `-` character placement (#12004) --- build/gen_stub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 1fff123d84c..0ab8ca26adf 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -272,7 +272,7 @@ class SimpleType { } $matches = []; - $isArray = preg_match("/array\s*<\s*([A-Za-z0-9_-|]+)?(\s*,\s*)?([A-Za-z0-9_-|]+)?\s*>/i", $typeString, $matches); + $isArray = preg_match("/array\s*<\s*([A-Za-z0-9_|-]+)?(\s*,\s*)?([A-Za-z0-9_|-]+)?\s*>/i", $typeString, $matches); if ($isArray) { if (empty($matches[1]) || empty($matches[3])) { throw new Exception("array<> type hint must have both a key and a value");