Skip to content

Commit

Permalink
Update CorreiosConsulta.php
Browse files Browse the repository at this point in the history
Normalização de espaço em branco retornado do DOMDocument no PHP retorna cadeias de caracteres. Substituída a função trim() por expressão regular.
  • Loading branch information
roalvesrj authored Dec 10, 2019
1 parent 5e4a552 commit 9ff1851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cagartner/CorreiosConsulta/CorreiosConsulta.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function cep($cep)
$innerHTML .= $child->ownerDocument->saveXML($child);
}
$texto = preg_replace("/&#?[a-z0-9]+;/i", "", $innerHTML);
$itens[] = trim($texto);
$itens[] = preg_replace(['(\s+)u', '(^\s|\s$)u'], [' ', ''], $texto);
}
$dados = array();
$dados['logradouro'] = trim($itens[0]);
Expand Down

0 comments on commit 9ff1851

Please sign in to comment.