Skip to content

Commit a451e65

Browse files
authored
Merge pull request #55 from marciocvitor/patch-1
Update Element.php
2 parents 0c57f3c + d7aa805 commit a451e65

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Common/Element.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ protected function isFieldInError($input, $param, $fieldname, $element, $require
213213
protected function validDoc(string $doc, string $field)
214214
{
215215
if ($doc != '0000000000000') {
216-
if (substr($doc, 0, 3) == '000') {
216+
if (substr($doc, 0, 3) == '000' and strlen($doc) < 14) {
217217
$result = Documents\Cpf::createFromString($doc);
218218
} else {
219219
$result = Documents\Cnpj::createFromString($doc);

0 commit comments

Comments
 (0)