diff --git a/inc/abstracttarget.class.php b/inc/abstracttarget.class.php index 66b3d0e04..f7d697d22 100644 --- a/inc/abstracttarget.class.php +++ b/inc/abstracttarget.class.php @@ -565,10 +565,12 @@ public function prepareInputForClone($input) { } protected static function getTemplateByName(string $name): int { + global $DB; + $targetTemplateType = (new static())->getTemplateItemtypeName(); $targetTemplate = new $targetTemplateType(); $targetTemplate->getFromDBByCrit([ - 'name' => $name, + 'name' => $DB->escape($name), ]); if ($targetTemplate->isNewItem()) {