diff --git a/application/Espo/Core/Utils/EntityManager.php b/application/Espo/Core/Utils/EntityManager.php index 411168656d..9c8ab485ca 100644 --- a/application/Espo/Core/Utils/EntityManager.php +++ b/application/Espo/Core/Utils/EntityManager.php @@ -132,6 +132,14 @@ class EntityManager throw new BadRequest(); } + if (strlen($name) > 100) { + throw new Error('Entity name should be less than 100.'); + } + + if (is_numeric($name[0])) { + throw new Error('Bad entity name.'); + } + if (!in_array($type, $this->getMetadata()->get(['app', 'entityTemplateList'], []))) { throw new Error('Type \''.$type.'\' does not exist.'); }