Do not reuse parameters variable names, just don't

This commit is contained in:
Stanislas Dolcini 2018-10-02 22:47:40 +02:00
parent 9da3a71d9d
commit b72c53f68f

View file

@ -190,8 +190,8 @@ function checkUserValidity($login, $password, $clientApplication, $cp, &$id, &$r
if (mysqli_num_rows($result) == 0) {
if ($AcceptUnknownUser) {
// login doesn't exist, create it
$password = mysqli_real_escape_string($link, $password);
$query = "INSERT INTO user (Login, Password) VALUES ('$login', '$password')";
$escaped_password = $mysqli->escape_string($password);
$query = "INSERT INTO user (Login, Password) VALUES ('$login', '$escaped_password')";
$result = mysqli_query($link, $query) or die(errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
// get the user to have his UId