diff options
author | Vincent Chan <plus.vincchan@gmail.com> | 2016-02-03 14:09:15 +0100 |
---|---|---|
committer | Vincent Chan <plus.vincchan@gmail.com> | 2016-02-03 14:09:15 +0100 |
commit | cc17ac9ff9e8b9efee94023bbacf50d1e7908873 (patch) | |
tree | 0b02a6e0a5761ed94b0e8f76ccd37be3f1882658 /lib/private | |
parent | 879917f5f1e1a02e34d89172de24f1d2ae0a1fab (diff) | |
download | nextcloud-server-cc17ac9ff9e8b9efee94023bbacf50d1e7908873.tar.gz nextcloud-server-cc17ac9ff9e8b9efee94023bbacf50d1e7908873.zip |
move whitspace check to user manager
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/user/manager.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php index 86750dcd994..6798a7340c3 100644 --- a/lib/private/user/manager.php +++ b/lib/private/user/manager.php @@ -265,6 +265,10 @@ class Manager extends PublicEmitter implements IUserManager { if (trim($uid) == '') { throw new \Exception($l->t('A valid username must be provided')); } + // No whitespace at the beginning or at the end + if (strlen(trim($uid, "\t\n\r\0\x0B\xe2\x80\x8b")) !== strlen(trim($uid))) { + throw new \Exception($l->t('Username contains whitespace at the beginning or at the end')); + } // No empty password if (trim($password) == '') { throw new \Exception($l->t('A valid password must be provided')); |