From d59a63079a69acd002be9b9a3390f6b170cc17fb Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Sun, 7 May 2023 16:25:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4html=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=BC=96=E7=A0=81xss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Library/Purifier.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Library/Purifier.php b/app/Library/Purifier.php index e73fb979..f2e571af 100644 --- a/app/Library/Purifier.php +++ b/app/Library/Purifier.php @@ -23,6 +23,7 @@ class Purifier */ protected $options = [ 'CSS.AllowedProperties' => 'color,font-size,text-align,background-color', + 'Core.EscapeNonASCIICharacters' => true, 'AutoFormat.AutoParagraph' => true, 'AutoFormat.RemoveEmpty' => true, 'HTML.TargetBlank' => true, @@ -57,7 +58,7 @@ class Purifier $serializerPath = cache_path('purifier'); - if (file_exists($serializerPath) == false) { + if (!file_exists($serializerPath)) { mkdir($serializerPath, 0777); }