From 0264ab4610fcb0a33e3e77271ec223402d4931d4 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Wed, 29 Apr 2020 15:04:10 +1200 Subject: [PATCH] Make the validation for the value of GA/GTM key accept wider condition --- src/formfields/GACodeField.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/formfields/GACodeField.php b/src/formfields/GACodeField.php index 55e0f50..7403ad6 100644 --- a/src/formfields/GACodeField.php +++ b/src/formfields/GACodeField.php @@ -35,7 +35,9 @@ public function validate($validator) if ($parts[0] === "GTM" && (mb_strlen($parts[1]) >= 4) && (mb_strlen($parts[1]) <= 8)) { return true; - } else if (($parts[0] === "UA") && mb_strlen($parts[1]) === 8 && mb_strlen($parts[2]) === 1) { + } else if (($parts[0] === "UA") + && (mb_strlen($parts[1]) >= 8 && mb_strlen($parts[1]) < 10) + && (mb_strlen($parts[2]) >= 1 && mb_strlen($parts[2]) < 3)) { return true; } else {