From 6aca1b16dc9be03a75e10bee4241e8edc36fadda Mon Sep 17 00:00:00 2001 From: Stanislas Date: Fri, 27 Dec 2024 09:09:08 +0100 Subject: [PATCH] Fix(SQL): sanitize data (#11) --- CHANGELOG.md | 6 ++++++ front/merge.php | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8900d07..bc0666e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Jamf Plugin for GLPI Changelog +## [UNRELEASED] + +### Fixes + +- SQL error when merging the Jamf device linked to a GLPI asset + ## [3.1.1] ### Fixes diff --git a/front/merge.php b/front/merge.php index 53cdc59..269e68c 100644 --- a/front/merge.php +++ b/front/merge.php @@ -29,6 +29,7 @@ */ use Glpi\Application\View\TemplateRenderer; +use Glpi\Toolbox\Sanitizer; include('../../../inc/includes.php'); @@ -73,7 +74,7 @@ 'WHERE' => [ 'OR' => [ 'uuid' => $data['udid'], - 'name' => $data['name'] + 'name' => Sanitizer::sanitize($data['name']) ], 'is_deleted' => 0, 'is_template' => 0