From 18bba7baec1babe197d1257a0a10a798a283f1bf Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 8 Feb 2018 13:15:49 +0200 Subject: [PATCH] entity manager fix --- application/Espo/Core/Utils/EntityManager.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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.'); }