@@ -205,6 +205,7 @@ public function input($type, $name, $value = null, $options = [])
205205 $ value = $ this ->getValueAttribute ($ name , $ value );
206206 $ options ['class ' ] = isset ($ options ['class ' ]) ? $ options ['class ' ] . (stripos ($ options ['class ' ], 'form-control ' ) !== false ? '' : ' form-control ' ) : 'form-control ' ;
207207 }
208+ $ value = $ this ->escape ($ value );
208209
209210 $ merge = compact ('type ' , 'value ' , 'id ' );
210211 $ options = array_merge ($ options , $ merge );
@@ -586,9 +587,9 @@ public function timepicker($name, $value, $options = [])
586587 public function datetimepicker ($ name , $ value , $ options = [])
587588 {
588589 $ defaults = [
589- 'data-date-format ' => "YYYY-MM-DD HH:mm:ss " ,
590+ 'data-date-format ' => "YYYY-MM-DD HH:mm:ss " ,
590591 // 兼容旧的用法
591- 'data-use-current ' => "true " ,
592+ 'data-use-current ' => "true " ,
592593 'data-date-use-current ' => "true " ,
593594 ];
594595 $ value = is_numeric ($ value ) ? date ("Y-m-d H:i:s " , $ value ) : $ value ;
@@ -680,6 +681,7 @@ public function fieldlist($name, $value, $title = null, $template = null, $optio
680681 return "<ins> {$ value }</ins> " ;
681682 }, $ title ));
682683 $ value = is_array ($ value ) ? json_encode ($ value ) : $ value ;
684+ $ value = $ this ->escape ($ value );
683685 $ html = <<<EOD
684686<dl class="fieldlist" data-name=" {$ name }" {$ template } {$ attributes }>
685687 <dd>
@@ -710,7 +712,8 @@ public function cxselect($url, $names = [], $values = [], $options = [])
710712 $ level = $ index + 1 ;
711713 $ class = "cxselect- {$ level }" ;
712714 $ classes [] = $ class ;
713- $ selectValue = isset ($ values [$ value ]) ? $ values [$ value ] : (isset ($ values [$ index ]) ? $ values [$ index ] : '' );
715+ $ selectValue = $ values [$ value ] ?? ($ values [$ index ] ?? '' );
716+ $ selectValue = $ this ->escape ($ selectValue );
714717
715718 $ cxselect [] = <<<EOD
716719<select class=" {$ class } form-control" name=" {$ value }" data-value=" {$ selectValue }" data-url=" {$ url }?level= {$ level }&name= {$ value }" {$ attributes }></select>
0 commit comments