add validation tests
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -183,6 +183,21 @@ class Database
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* return number of characters that are allowed to use as username
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getSqlUsernameLength()
|
||||
{
|
||||
// MySQL user names can be up to 32 characters long (16 characters before MySQL 5.7.8).
|
||||
$mysql_max = 32;
|
||||
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.8', '<')) {
|
||||
$mysql_max -= 16;
|
||||
}
|
||||
return $mysql_max;
|
||||
}
|
||||
|
||||
/**
|
||||
* let's us interact with the PDO-Object by using static
|
||||
* call like "Database::function()"
|
||||
|
||||
Reference in New Issue
Block a user