From f62ee77852eebcb02834f1bd2e217ad20df2f922 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Thu, 12 Dec 2019 10:31:13 -0800 Subject: [PATCH] Fix count() warning In PHP 7.2 and later you will get a warning if you call count() on null. So either initialize $errors to an empty array here, or use empty() to check it as I have done here. --- include/functions_user.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index df33f29ce..932b5d362 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -170,7 +170,7 @@ function register_user($login, $password, $mail_address, $notify_admin=true, &$e ); // if no error until here, registration of the user - if (count($errors) == 0) + if (empty($errors)) { $insert = array( $conf['user_fields']['username'] => pwg_db_real_escape_string($login),