mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
Prevent user with empty uid
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
3a0e06147c
commit
0ae9a2c9fe
1 changed files with 7 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author Morris Jobke <hey@morrisjobke.de>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
|
|
@ -111,6 +112,12 @@ class User {
|
|||
IConfig $config, FilesystemHelper $fs, Image $image,
|
||||
LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager) {
|
||||
|
||||
if ($username === null) {
|
||||
throw new \InvalidArgumentException("uid for '$dn' must not be null!");
|
||||
} else if ($username === '') {
|
||||
throw new \InvalidArgumentException("uid for '$dn' must not be an empty string!");
|
||||
}
|
||||
|
||||
$this->access = $access;
|
||||
$this->connection = $access->getConnection();
|
||||
$this->config = $config;
|
||||
|
|
|
|||
Loading…
Reference in a new issue