1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-14 21:02:31 +02:00

[ticket/16605] Fix possible SQL error on user registration

mysqli_insert_id() returns 0 if there was no previous query on the connection
or if the query did not update an AUTO_INCREMENT value for some reason.

PHPBB3-16605
This commit is contained in:
rxu 2020-09-29 21:10:06 +07:00
parent 6b92f23c81
commit 00849941c3
No known key found for this signature in database
GPG Key ID: 955F0567380E586A

View File

@ -424,7 +424,7 @@ class ucp_register
$user_id = user_add($user_row, $cp_data);
// This should not happen, because the required variables are listed above...
if ($user_id === false)
if ((bool) $user_id === false)
{
trigger_error('NO_USER', E_USER_ERROR);
}