From 1796c4974021229ad5a2ec75c4b24ff1c956d004 Mon Sep 17 00:00:00 2001 From: augushong Date: Tue, 11 Oct 2022 19:32:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ua=5Fhtmlspecialchars=5Fdecod?= =?UTF-8?q?e=E5=87=BD=E6=95=B0=E5=85=BC=E5=AE=B9PHP8.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/mall/goods/read.html | 2 +- app/common.php | 13 +++++++++++++ view/index/welcome.html | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/admin/view/mall/goods/read.html b/app/admin/view/mall/goods/read.html index 8a40057..d627b86 100644 --- a/app/admin/view/mall/goods/read.html +++ b/app/admin/view/mall/goods/read.html @@ -101,7 +101,7 @@
- {$row.describe|raw|htmlspecialchars_decode} + {$row.describe|raw|ua_htmlspecialchars_decode}
diff --git a/app/common.php b/app/common.php index b64d038..50a7ad5 100644 --- a/app/common.php +++ b/app/common.php @@ -246,6 +246,19 @@ if (!function_exists('ua_htmlentities')) { } } +if (!function_exists('htmlspecialchars_decode')) { + function ua_htmlspecialchars_decode($string, $flag = ENT_QUOTES | ENT_SUBSTITUTE) + { + + if (is_null($string)) { + $string = ''; + } + + return ua_htmlspecialchars_decode($string, $flag); + } +} + + function build_upload_url($url, $upload_type = null) { diff --git a/view/index/welcome.html b/view/index/welcome.html index f7d36ad..6fb7db5 100644 --- a/view/index/welcome.html +++ b/view/index/welcome.html @@ -166,7 +166,7 @@ }) }) - {:htmlspecialchars_decode(sysconfig('site','site_js_insert'))} + {:ua_htmlspecialchars_decode(sysconfig('site','site_js_insert'))} \ No newline at end of file