Skip to content

Commit

Permalink
fix(abstracttarget): missing escaping before SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed May 24, 2024
1 parent 8a8f8d4 commit 6747e99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/abstracttarget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 6747e99

Please sign in to comment.