File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,17 @@ class Rule extends Backend
5454 public function initialize (): void
5555 {
5656 parent ::initialize ();
57- $ this ->model = new AdminRule ();
58- $ this ->tree = Tree::instance ();
5957
60- $ isTree = $ this ->request ->param ('isTree ' , true );
61- $ this ->initValue = $ this ->request ->get ('initValue/a ' , []);
62- $ this ->initValue = array_filter ($ this ->initValue );
63- $ this ->keyword = $ this ->request ->request ('quickSearch ' , '' );
58+ // 防止 URL 中的特殊符号被默认的 filter 函数转义
59+ $ this ->request ->filter ('clean_xss ' );
6460
65- // 有初始化值时不组装树状(初始化出来的值更好看)
66- $ this ->assembleTree = $ isTree && !$ this ->initValue ;
61+ $ this ->model = new AdminRule ();
62+ $ this ->tree = Tree::instance ();
63+ $ isTree = $ this ->request ->param ('isTree ' , true );
64+ $ this ->initValue = $ this ->request ->get ('initValue/a ' , []);
65+ $ this ->initValue = array_filter ($ this ->initValue );
66+ $ this ->keyword = $ this ->request ->request ('quickSearch ' , '' );
67+ $ this ->assembleTree = $ isTree && !$ this ->initValue ; // 有初始化值时不组装树状(初始化出来的值更好看)
6768 }
6869
6970 public function index (): void
Original file line number Diff line number Diff line change @@ -48,16 +48,17 @@ class Rule extends Backend
4848 public function initialize (): void
4949 {
5050 parent ::initialize ();
51- $ this ->model = new UserRule ();
52- $ this ->tree = Tree::instance ();
5351
54- $ isTree = $ this ->request ->param ('isTree ' , true );
55- $ this ->initValue = $ this ->request ->get ("initValue/a " , []);
56- $ this ->initValue = array_filter ($ this ->initValue );
57- $ this ->keyword = $ this ->request ->request ('quickSearch ' , '' );
52+ // 防止 URL 中的特殊符号被默认的 filter 函数转义
53+ $ this ->request ->filter ('clean_xss ' );
5854
59- // 有初始化值时不组装树状(初始化出来的值更好看)
60- $ this ->assembleTree = $ isTree && !$ this ->initValue ;
55+ $ this ->model = new UserRule ();
56+ $ this ->tree = Tree::instance ();
57+ $ isTree = $ this ->request ->param ('isTree ' , true );
58+ $ this ->initValue = $ this ->request ->get ("initValue/a " , []);
59+ $ this ->initValue = array_filter ($ this ->initValue );
60+ $ this ->keyword = $ this ->request ->request ('quickSearch ' , '' );
61+ $ this ->assembleTree = $ isTree && !$ this ->initValue ; // 有初始化值时不组装树状(初始化出来的值更好看)
6162 }
6263
6364 public function index (): void
You can’t perform that action at this time.
0 commit comments