From 00849941c3ffad136176355403da2f45dc56e286 Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 29 Sep 2020 21:10:06 +0700 Subject: [PATCH] [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 --- phpBB/includes/ucp/ucp_register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 6709123dfd..fa3b87d90a 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -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); }