From b3a442521546ac459018a7fc98f5d9e554f122c2 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Jul 2022 09:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9php8.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 12 ++++++++++++ config/view.php | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/common.php b/app/common.php index 3001929..b64d038 100644 --- a/app/common.php +++ b/app/common.php @@ -234,6 +234,18 @@ if (!function_exists('ua_htmlspecialchars')) { } } +if (!function_exists('ua_htmlentities')) { + function ua_htmlentities($string) + { + + if (is_null($string)) { + $string = ''; + } + + return htmlentities($string); + } +} + function build_upload_url($url, $upload_type = null) { diff --git a/config/view.php b/config/view.php index 571eb0a..e97254f 100644 --- a/config/view.php +++ b/config/view.php @@ -30,5 +30,6 @@ return [ 'tpl_replace_string' => [ '__STATIC__' => Env::get('adminsystem.static_path', '/static'), '__JS__' => '/static/javascript', - ] + ], + 'default_filter' => 'ua_htmlentities', // 默认过滤方法 用于普通标签输出 ];