@@ -22,16 +22,16 @@ class DLPViewer
22
22
* @param string $title 名称
23
23
* @param array $select 全部选项
24
24
* @param array $selected 已选择选项
25
- * @param bool $strict json严格模式
25
+ * @param bool $strict json严格模式 消除json敏感字符问题
26
26
*/
27
- public static function makeComponentDot (Form $ form , string $ column , string $ title , array $ select = [], array $ selected = [],bool $ strict = true )
27
+ public static function makeComponentDot (Form $ form , string $ column , string $ title , array $ select = [], array $ selected = [],bool $ strict = false )
28
28
{
29
29
if ($ strict ) {
30
30
$ select = self ::safeJson ($ select );
31
31
$ selected = self ::safeJson ($ selected );
32
32
} else {
33
- $ select = json_encode ($ select , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS );
34
- $ selected = json_encode ($ selected , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS );
33
+ $ select = json_encode ($ select , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS );
34
+ $ selected = json_encode ($ selected , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS );
35
35
}
36
36
Admin::script (<<<EOF
37
37
componentDot(" {$ column }",JSON.parse(' {$ selected }'),JSON.parse(' {$ select }'));
@@ -47,16 +47,16 @@ public static function makeComponentDot(Form $form, string $column, string $titl
47
47
* @param string $title 名称
48
48
* @param array $settings 设置项
49
49
* @param array $data 数据
50
- * @param bool $strict json严格模式
50
+ * @param bool $strict json严格模式 消除json敏感字符问题
51
51
*/
52
- public static function makeComponentLine (Form $ form , string $ column , string $ title , array $ settings = [], array $ data = [], bool $ strict = true )
52
+ public static function makeComponentLine (Form $ form , string $ column , string $ title , array $ settings = [], array $ data = [], bool $ strict = false )
53
53
{
54
54
if ($ strict ) {
55
55
$ data = self ::safeJson ($ data );
56
56
}else {
57
57
$ data = json_encode ($ data , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS );
58
58
}
59
- $ settings = json_encode ($ settings , JSON_UNESCAPED_UNICODE );
59
+ $ settings = json_encode ($ settings , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS );
60
60
Admin::script (<<<EOF
61
61
componentLine(" {$ column }",JSON.parse(' {$ settings }'),JSON.parse(' {$ data }'));
62
62
EOF
0 commit comments