mirror of
https://github.com/Respect/Validation.git
synced 2024-06-01 21:32:14 +02:00
Fix bug to validate "01234567890" input in CPF rule
This commit is contained in:
parent
120d924d8d
commit
f246939221
|
@ -18,7 +18,7 @@ class Cpf extends AbstractRule
|
|||
// Code ported from jsfromhell.com
|
||||
$c = preg_replace('/\D/', '', $input);
|
||||
|
||||
if (strlen($c) != 11 || preg_match("/^{$c[0]}{11}$/", $c)) {
|
||||
if (strlen($c) != 11 || preg_match("/^{$c[0]}{11}$/", $c) || $c === '01234567890') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ class CpfTest extends TestCase
|
|||
public function providerInvalidUnformattedCpf()
|
||||
{
|
||||
return [
|
||||
['01234567890'],
|
||||
['11111111111'],
|
||||
['22222222222'],
|
||||
['12345678900'],
|
||||
|
|
Loading…
Reference in a new issue