Skip to content

Commit 7148fca

Browse files
committed
fix: allow names with spaces
1 parent 7ddfb30 commit 7148fca

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ return [
105105
'formNameRequired' => true,
106106
'formEmailRequired' => true,
107107
'formMessageRequired' => true,
108-
'formNamePattern' => '[^\s]{3,}',
108+
'formNamePattern' => '(?=.*\S).{2,}',
109109
'formEmailPattern' => '[^\s@]+@[^\s@]+\.[^\s@]+',
110110
'theme' => 'basic', // default no theme, use 'basic' for a default theme
111111
],
@@ -129,7 +129,7 @@ return [
129129
| `formNameRequired` | `true` | Require the name field |
130130
| `formEmailRequired` | `true` | Require the email field |
131131
| `formMessageRequired` | `true` | Require the message field |
132-
| `formNamePattern` | `[^\s]{3,}` | Pattern for the name field |
132+
| `formNamePattern` | `(?=.*\S).{3,}` | Pattern for the name field |
133133
| `formEmailPattern` | `[^\s@]+@[^\s@]+\.[^\s@]+` | Pattern for the email field |
134134
| `theme` | | Set to 'basic' for some basic styling |
135135

index.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
'formNameRequired' => true,
1919
'formEmailRequired' => true,
2020
'formMessageRequired' => true,
21-
'formNamePattern' => '[^\s]{3,}',
21+
'formNamePattern' => '(?=.*\S).{2,}',
2222
'formEmailPattern' => '[^\s@]+@[^\s@]+\.[^\s@]+',
2323
'theme' => '',
2424
],
@@ -85,5 +85,3 @@
8585
]
8686
]
8787
]);
88-
89-

0 commit comments

Comments
 (0)