mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
fix(CRUD):修复生成单选框组件时报错的问题
This commit is contained in:
parent
450df7bd06
commit
70eb0ace5e
@ -74,7 +74,7 @@ class Crud extends Backend
|
||||
{
|
||||
$type = $this->request->post('type', '');
|
||||
$table = $this->request->post('table', []);
|
||||
$fields = $this->request->post('fields', [], 'clean_xss,htmlspecialchars_decode');
|
||||
$fields = $this->request->post('fields', [], 'clean_xss,htmlspecialchars_decode_improve');
|
||||
|
||||
if (!$table || !$fields || !isset($table['name']) || !$table['name']) {
|
||||
$this->error(__('Parameter error'));
|
||||
|
@ -68,6 +68,20 @@ if (!function_exists('clean_xss')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('htmlspecialchars_decode_improve')) {
|
||||
/**
|
||||
* html解码增强
|
||||
* 被 clean_xss函数 和 filter函数 内的 htmlspecialchars 编码的字符串,需要用此函数才能完全解码
|
||||
* @param string $string
|
||||
* @param int $flags
|
||||
* @return string
|
||||
*/
|
||||
function htmlspecialchars_decode_improve(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401): string
|
||||
{
|
||||
return htmlspecialchars_decode($string, $flags);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('get_sys_config')) {
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user