zxcvbn-php icon indicating copy to clipboard operation
zxcvbn-php copied to clipboard

Fix type error

Open pulzarraider opened this issue 2 years ago • 5 comments

This fix Uncaught TypeError: factorial(): Return value must be of type int, float returned. If the $nparameter in factorial() is bigger than 20, it will cause type error because PHP converts int to float.

Demonstration: https://onlinephp.io/c/3bbad

pulzarraider avatar May 19 '22 19:05 pulzarraider

Can confirm this

calvinalkan avatar May 20 '22 21:05 calvinalkan

Do you have a sample of what input is triggering this?

Xon avatar May 31 '22 05:05 Xon

@Xon no. Passwords in our logs are anonymized so I can't give you the input value that triggered this error. But it is very rare.

pulzarraider avatar Jun 06 '22 00:06 pulzarraider

Password: 123 12345 654321 abcdef gfedcb kuulilennuteetunneliluuk dog fghij mnopq 66666 1010101 loop

alexkuusk avatar Sep 16 '22 09:09 alexkuusk

Isn't this caused by the changes in 1.3.1? Is it same problem in 1.3.0?

Also, why not just say the function can return a float, as a solution?

tomsommer avatar Dec 29 '22 08:12 tomsommer