fix(CRUD):修复生成单选框组件时报错的问题

This commit is contained in:
妙码生花 2023-08-16 00:42:15 +08:00
parent 450df7bd06
commit 70eb0ace5e
2 changed files with 15 additions and 1 deletions

View File

@ -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'));

View File

@ -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')) {
/**