Skip to content

Commit

Permalink
Fix Validations::pattern()
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Jul 31, 2024
1 parent 693169b commit a0d8090
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Form/Validations.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static function pattern(Field|FieldClass $field, mixed $value): bool
// ensure that that pattern needs to match the whole
// input value from start to end, not just a partial match
// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern#overview
$pattern = '^(?:' . trim($pattern, '/') . ')$';
$pattern = '^(?:' . $pattern . ')$';

if (V::match($value, '/' . $pattern . '/i') === false) {
throw new InvalidArgumentException(
Expand Down

0 comments on commit a0d8090

Please sign in to comment.