From e530ffa24f8ae9657f23809f265f9f6628325ff3 Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 11:36:23 +0000 Subject: Bug fix: test username's length (max 25) when registering (preventing problem with database git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@155 b3834d28-1941-0410-a4f8-b48e95affb8f --- services/userservice.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'services') diff --git a/services/userservice.php b/services/userservice.php index ee62dbb..e50faaa 100644 --- a/services/userservice.php +++ b/services/userservice.php @@ -388,6 +388,18 @@ class UserService { return false; } } + + function isValidUsername($username) { + if (strlen($username) > 24) { + // too long usernames are cut by database and may cause bugs when compared + return false; + } else { + return true; + } + return true; + } + + function isValidEmail($email) { if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", $email)) { -- cgit v1.2.3