Password set as 2147483647
Through Android i create a new user and 1 of 5 times the password becomes automatically on 2147483647. I used Google to found a possible answer to that and some people say it's an overflow caused by Apache
Here's a piese os the code:
public function userRegisterAction(Request $request) {
......
$getPass = $request->query->get('password');
$userManager = $this->container->get('fos_user.user_manager');
$newUser->setUsername($getUser);
$newUser->setPlainPassword($getPass);
......
$userManager->updateUser($newUser);
}
Any help is welcome :)
what is the content of $getPass here ? Is it 2147483647 or your real password ?
It seems its a number that gets converted to an integer, and overflows.
well, if the password you pass to FOSUserBundle is already this number, there is no bug in FOSUserBundle, but in the code you are running before.
For example, as a password i set "example12345" and 1 of 5 times automatically the password is 2147483647. Even i looked the User.php inside of FOS/UserBundule/Model/User and the Password variable is a protected string.
I don't know if i solved the problem but I created around 10 users with the App and works perfect. I used (string) before the $request
$getPass = (string) $request->query->get('password');
I found a possible explication of the problem:
When posting a string of numbers with an integer representation greater than 2147483647, PHP casts the string to an integer type and sets the value to 2147483647.
Symfony should check for posted values and overflows - casting integers larger than the maximum allowed to strings.
Anyway, thanks for the help :)