From 2aa08a11d4ef0ec4abf82490777bad72b4199a90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2016 15:10:14 +0100 Subject: [PATCH] Support a nulled password in UserEditor::create() --- wcfsetup/install/files/lib/data/user/UserEditor.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/user/UserEditor.class.php b/wcfsetup/install/files/lib/data/user/UserEditor.class.php index c1a19a1642..4a2e0cd03a 100644 --- a/wcfsetup/install/files/lib/data/user/UserEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/UserEditor.class.php @@ -40,7 +40,12 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject { public static function create(array $parameters = []) { // create salt and password hash if ($parameters['password'] !== '') { - $parameters['password'] = PasswordUtil::getDoubleSaltedHash($parameters['password']); + if ($parameters['password'] !== null) { + $parameters['password'] = PasswordUtil::getDoubleSaltedHash($parameters['password']); + } + else { + $parameters['password'] = 'invalid:'; + } } // create accessToken for AbstractAuthedPage -- 2.20.1