Skip to content

Commit 19abad4

Browse files
committed
Check for empty string
1 parent f2ce1b3 commit 19abad4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Rules/Name.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public function __construct(bool $allowNumber = false, string $errorMessage = nu
4747
*/
4848
public function passes($attribute, $value)
4949
{
50+
// check empty
51+
if (!trim($value)) {
52+
return false;
53+
}
54+
5055
// check no emoji
5156
if (preg_match('/\p{S}/u', $value)) {
5257
return false;

0 commit comments

Comments
 (0)