Skip to content

Commit 4441ec3

Browse files
committed
fix regexp and docs
1 parent bf87fe7 commit 4441ec3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,19 +334,19 @@ protected function getDateTime($value)
334334
}
335335

336336
/**
337-
* Validate that an attribute contains only alphabetic characters.
337+
* Validate that an attribute contains only ascii alphabetic characters.
338338
*
339339
* @param string $attribute
340340
* @param mixed $value
341341
* @return bool
342342
*/
343343
public function validateAlpha($attribute, $value)
344344
{
345-
return is_string($value) && preg_match('/^[\pL\pM]+$/u', $value);
345+
return is_string($value) && preg_match('/^[a-zA-Z]+$/u', $value) > 0;
346346
}
347347

348348
/**
349-
* Validate that an attribute contains only alpha-numeric characters, dashes, and underscores.
349+
* Validate that an attribute contains only ascii alpha-numeric characters, dashes, and underscores.
350350
*
351351
* @param string $attribute
352352
* @param mixed $value
@@ -358,11 +358,11 @@ public function validateAlphaDash($attribute, $value)
358358
return false;
359359
}
360360

361-
return preg_match('/^[\pL\pM\pN_-]+$/u', $value) > 0;
361+
return preg_match('/^[a-zA-Z0-9_-]+$/u', $value) > 0;
362362
}
363363

364364
/**
365-
* Validate that an attribute contains only alpha-numeric characters.
365+
* Validate that an attribute contains only ascii alpha-numeric characters.
366366
*
367367
* @param string $attribute
368368
* @param mixed $value
@@ -374,7 +374,7 @@ public function validateAlphaNum($attribute, $value)
374374
return false;
375375
}
376376

377-
return preg_match('/^[\pL\pM\pN]+$/u', $value) > 0;
377+
return preg_match('/^[a-zA-Z0-9]+$/u', $value) > 0;
378378
}
379379

380380
/**

0 commit comments

Comments
 (0)