From 632f6497984480aca7989a5328f924aa894c9987 Mon Sep 17 00:00:00 2001 From: Eduardo Aguad Date: Tue, 5 Sep 2017 10:39:12 -0300 Subject: [PATCH] Remove intval() to avoid truncating string and deleting unexpected characters --- src/Rut.php | 2 +- tests/unit/RutTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rut.php b/src/Rut.php index ce366ff..1e5918b 100644 --- a/src/Rut.php +++ b/src/Rut.php @@ -141,7 +141,7 @@ public function number($number = null) { if ($number !== null) { - $this->number = intval($this->escape($number)); + $this->number = $this->escape($number); return $this; } return $this->number; diff --git a/tests/unit/RutTest.php b/tests/unit/RutTest.php index cbeb660..db2f927 100644 --- a/tests/unit/RutTest.php +++ b/tests/unit/RutTest.php @@ -17,7 +17,7 @@ public function testValidation() { $this->ruts = [ 'valid' => ['11.111.111-1','111111111','11111112-K','11111112-k'], - 'invalid' => ['11111112-9','1234k678-3','123-1','123.456.789-2','11.111.111-L'] + 'invalid' => ['11111112-9','17601065fail-7','123-1','123.456.789-2','11.111.111-L'] ]; /***********************