From 534b6f3a098c8f2bb5993592e73f5af75c3c86bc Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 2 Jan 2012 11:49:53 +0100 Subject: [PATCH] Fix whitespace username --- lib/user.php | 2 +- settings/js/users.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/user.php b/lib/user.php index 241d9aa8b10..0a5881ec0f8 100644 --- a/lib/user.php +++ b/lib/user.php @@ -120,7 +120,7 @@ class OC_User { return false; } // No empty username - if( !$uid ){ + if(trim($uid) == ''){ return false; } // Check if user already exists diff --git a/settings/js/users.js b/settings/js/users.js index 4fea52e4a1f..79b4e80870a 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -126,7 +126,7 @@ $(document).ready(function(){ $('#newuser').submit(function(event){ event.preventDefault(); var username=$('#newusername').val(); - if(username == '') { + if($.trim(username) == '') { alert('Please provide a username!'); return false; } -- 2.39.5