Fix bug to validate "01234567890" input in CPF rule

This commit is contained in:
Paulo Dias 2019-03-29 13:25:30 -03:00
parent 120d924d8d
commit f246939221
2 changed files with 2 additions and 1 deletions

View file

@ -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;
}

View file

@ -108,6 +108,7 @@ class CpfTest extends TestCase
public function providerInvalidUnformattedCpf()
{
return [
['01234567890'],
['11111111111'],
['22222222222'],
['12345678900'],