Skip to content

Commit

Permalink
Merge pull request #3 from chrometoasters/feature/validation-loose
Browse files Browse the repository at this point in the history
Make the validation for the value of GA/GTM key accept wider condition
  • Loading branch information
normann authored Apr 29, 2020
2 parents 572ccbc + 0264ab4 commit 595f10f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/formfields/GACodeField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 595f10f

Please sign in to comment.