auraphp / Aura.Filter

Validate and sanitize arrays and objects.
MIT License
159 stars 33 forks source link

Fixed sanitize double rule, when remove all minuses not at the front #139

Closed frugan-dev closed 5 years ago

harikt commented 5 years ago

Hi there,

Can you write a test for this?

harikt commented 5 years ago

I don't see a problem in this current implementation. What makes you think this has a bug ?

frugan-dev commented 5 years ago

Hi there,

if $value is a string https://github.com/auraphp/Aura.Filter/blob/f9720709ddb43f6fe59ed12ebb6537f2a3eeeadf/src/Rule/Sanitize/Double.php#L52 how could it be $value[0] here https://github.com/auraphp/Aura.Filter/blob/f9720709ddb43f6fe59ed12ebb6537f2a3eeeadf/src/Rule/Sanitize/Double.php#L77 ?

$value is not an array..

harikt commented 5 years ago

@ewake

$hey = "Hello";

echo $hey[0];

You can see the result online : https://3v4l.org/hrLoE

So nothing wrong right ?

frugan-dev commented 5 years ago

Wow, thank you! I didn't know this.. Sorry, happy new year!

harikt commented 5 years ago

@ewake Happy New year to you too. Enjoy! .