@@ -453,7 +453,9 @@ function plugin_formcreator_hook_update_ticket(CommonDBTM $item) {
453
453
454
454
$ validationStatus = PluginFormcreatorCommon::getTicketStatusForIssue ($ item );
455
455
456
- $ issueName = $ item ->fields ['name ' ] != '' ? addslashes ($ item ->fields ['name ' ]) : '( ' . $ item ->getID () . ') ' ;
456
+ $ issueName = $ item ->fields ['name ' ] != ''
457
+ ? $ item ->fields ['name ' ]
458
+ : '( ' . $ item ->getID () . ') ' ;
457
459
$ issue = new PluginFormcreatorIssue ();
458
460
$ issue ->getFromDBByCrit ([
459
461
'AND ' => [
@@ -480,14 +482,14 @@ function plugin_formcreator_hook_update_ticket(CommonDBTM $item) {
480
482
'items_id ' => $ id ,
481
483
'display_id ' => "t_ $ id " ,
482
484
'itemtype ' => Ticket::class,
483
- 'name ' => $ issueName ,
485
+ 'name ' => $ DB -> escape ( $ issueName) ,
484
486
'status ' => $ validationStatus ,
485
487
'date_creation ' => $ item ->fields ['date ' ],
486
488
'date_mod ' => $ item ->fields ['date_mod ' ],
487
489
'entities_id ' => $ item ->fields ['entities_id ' ],
488
490
'is_recursive ' => '0 ' ,
489
491
'requester_id ' => $ requester ,
490
- 'comment ' => addslashes ($ item ->fields ['content ' ]),
492
+ 'comment ' => $ DB -> escape ($ item ->fields ['content ' ]),
491
493
]);
492
494
}
493
495
@@ -611,7 +613,10 @@ function plugin_formcreator_hook_update_ticketvalidation(CommonDBTM $item) {
611
613
if ($ issue ->isNewItem ()) {
612
614
return ;
613
615
}
614
- $ issue ->update (['status ' => $ status ] + $ issue ->fields );
616
+ $ issue ->update ([
617
+ 'id ' => $ issue ->getID (),
618
+ 'status ' => $ status
619
+ ]);
615
620
}
616
621
617
622
function plugin_formcreator_hook_update_itilFollowup ($ followup ) {
0 commit comments