MDL-53495 database xmldb: Use real length restriction.

This commit is contained in:
Russell Smith 2016-03-16 14:35:29 +11:00
parent 4ee8ef5d41
commit 0b768e744f
6 changed files with 12 additions and 9 deletions

View file

@ -714,7 +714,7 @@ class xmldb_table extends xmldb_object {
// table parameter is ignored
$name = $this->getName();
if (strlen($name) > self::NAME_MAX_LENGTH) {
return 'Invalid table name {'.$name.'}: name is too long. Limit is 28 chars.';
return 'Invalid table name {'.$name.'}: name is too long. Limit is '.self::NAME_MAX_LENGTH.' chars.';
}
if (!preg_match('/^[a-z][a-z0-9_]*$/', $name)) {
return 'Invalid table name {'.$name.'}: name includes invalid characters.';