don't cast mysql-max to integer as for admins-usernames, it may be '' instead of 0

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-12-08 22:00:23 +01:00
parent 2b13ae3ad8
commit 3b0387901f

View File

@@ -35,6 +35,6 @@ function validateUsername($username, $unix_names = 1, $mysql_max = '') {
return false;
}
} else {
return (preg_match('/^[a-z][a-z0-9]{1,' . (int)$mysql_max . '}$/Di', $username) != false);
return (preg_match('/^[a-z][a-z0-9]{1,' . $mysql_max . '}$/Di', $username) != false);
}
}