36
36
function plugin_formcreator_update_2_6_3 () {
37
37
global $ DB ;
38
38
39
+ // Change id of search option for status of form_answer
40
+ $ table = 'glpi_displaypreferences ' ;
41
+ $ query = "UPDATE ` $ table` SET `num`='8' WHERE `itemtype`='PluginFormcreatorForm_Answer' AND `num`='1' " ;
42
+ $ DB ->query ($ query );
43
+
39
44
// Remove abusive encding in sections
40
45
$ table = 'glpi_plugin_formcreator_sections ' ;
41
46
$ request = [
@@ -47,4 +52,40 @@ function plugin_formcreator_update_2_6_3() {
47
52
$ id = $ row ['id ' ];
48
53
$ DB ->query ("UPDATE ` $ table` SET `name`=' $ name' WHERE `id` = ' $ id' " );
49
54
}
55
+
56
+ // Remove abusive encoding in targets
57
+ $ table = 'glpi_plugin_formcreator_targets ' ;
58
+ $ request = [
59
+ 'FROM ' => $ table ,
60
+ ];
61
+ foreach ($ DB ->request ($ request ) as $ row ) {
62
+ $ id = $ row ['id ' ];
63
+ $ name = Toolbox::addslashes_deep (html_entity_decode ($ row ['name ' ], ENT_QUOTES |ENT_HTML5 ));
64
+ $ id = $ row ['id ' ];
65
+ $ DB ->query ("UPDATE ` $ table` SET `name`=' $ name' WHERE `id` = ' $ id' " );
66
+ }
67
+
68
+ // Remove abusive encding in target tickets
69
+ $ table = 'glpi_plugin_formcreator_targettickets ' ;
70
+ $ request = [
71
+ 'FROM ' => $ table ,
72
+ ];
73
+ foreach ($ DB ->request ($ request ) as $ row ) {
74
+ $ id = $ row ['id ' ];
75
+ $ name = Toolbox::addslashes_deep (html_entity_decode ($ row ['name ' ], ENT_QUOTES |ENT_HTML5 ));
76
+ $ id = $ row ['id ' ];
77
+ $ DB ->query ("UPDATE ` $ table` SET `name`=' $ name' WHERE `id` = ' $ id' " );
78
+ }
79
+
80
+ // Remove abusive encding in target changes
81
+ $ table = 'glpi_plugin_formcreator_targetchanges ' ;
82
+ $ request = [
83
+ 'FROM ' => $ table ,
84
+ ];
85
+ foreach ($ DB ->request ($ request ) as $ row ) {
86
+ $ id = $ row ['id ' ];
87
+ $ name = Toolbox::addslashes_deep (html_entity_decode ($ row ['name ' ], ENT_QUOTES |ENT_HTML5 ));
88
+ $ id = $ row ['id ' ];
89
+ $ DB ->query ("UPDATE ` $ table` SET `name`=' $ name' WHERE `id` = ' $ id' " );
90
+ }
50
91
}
0 commit comments