mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
refactor:去除多余的 htmlspecialchars 参数
This commit is contained in:
parent
d5ade8d027
commit
793c7f63ca
@ -58,13 +58,11 @@ if (!function_exists('clean_xss')) {
|
||||
* 清理XSS
|
||||
* 通常只用于富文本,比 filter 慢
|
||||
* @param string $string
|
||||
* @param bool $htmlspecialchars
|
||||
* @return string
|
||||
*/
|
||||
function clean_xss(string $string, bool $htmlspecialchars = true): string
|
||||
function clean_xss(string $string): string
|
||||
{
|
||||
$string = (new AntiXSS())->xss_clean($string);
|
||||
return $htmlspecialchars ? htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8') : $string;
|
||||
return (new AntiXSS())->xss_clean($string);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user