From 1675a07c9b84a9164353a1ba1e610ae72dba98f8 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Sun, 12 Feb 2023 20:23:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E5=8D=95?= =?UTF-8?q?=E5=BC=95=E5=8F=B7=20html=20encode=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beike/Admin/View/Components/Form/Input.php | 2 +- beike/Admin/View/Components/Form/RichText.php | 2 +- beike/Admin/View/Components/Form/Textarea.php | 2 +- beike/Console/Commands/MigrateFromOpenCart.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/beike/Admin/View/Components/Form/Input.php b/beike/Admin/View/Components/Form/Input.php index 1e9c4361..521bf2d0 100644 --- a/beike/Admin/View/Components/Form/Input.php +++ b/beike/Admin/View/Components/Form/Input.php @@ -26,7 +26,7 @@ class Input extends Component { $this->name = $name; $this->title = $title; - $this->value = html_entity_decode($value); + $this->value = html_entity_decode($value, ENT_QUOTES); $this->error = $error; $this->width = $width; $this->type = $type; diff --git a/beike/Admin/View/Components/Form/RichText.php b/beike/Admin/View/Components/Form/RichText.php index 75c84b10..f161187f 100644 --- a/beike/Admin/View/Components/Form/RichText.php +++ b/beike/Admin/View/Components/Form/RichText.php @@ -18,7 +18,7 @@ class RichText extends Component { $this->name = $name; $this->title = $title; - $this->value = html_entity_decode($value); + $this->value = html_entity_decode($value, ENT_QUOTES); $this->required = $required; } diff --git a/beike/Admin/View/Components/Form/Textarea.php b/beike/Admin/View/Components/Form/Textarea.php index b4767b41..b0ed7ef1 100644 --- a/beike/Admin/View/Components/Form/Textarea.php +++ b/beike/Admin/View/Components/Form/Textarea.php @@ -18,7 +18,7 @@ class Textarea extends Component { $this->name = $name; $this->title = $title; - $this->value = html_entity_decode($value); + $this->value = html_entity_decode($value, ENT_QUOTES); $this->required = $required; } diff --git a/beike/Console/Commands/MigrateFromOpenCart.php b/beike/Console/Commands/MigrateFromOpenCart.php index 15f55827..da8fedf3 100644 --- a/beike/Console/Commands/MigrateFromOpenCart.php +++ b/beike/Console/Commands/MigrateFromOpenCart.php @@ -104,7 +104,7 @@ class MigrateFromOpenCart extends Command 'category_id' => $description->category_id, 'locale' => $langMapping[$description->language_id], 'name' => $description->name, - 'content' => html_entity_decode($description->description), + 'content' => html_entity_decode($description->description, ENT_QUOTES), 'created_at' => now(), 'updated_at' => now(), ]; @@ -283,7 +283,7 @@ class MigrateFromOpenCart extends Command $ocDescription = $ocDescriptions[self::LANG_MAPPING[$locale['code']]]; $descriptions[$locale['code']] = [ 'name' => $ocDescription->name, - 'content' => html_entity_decode($ocDescription->description), + 'content' => html_entity_decode($ocDescription->description, ENT_QUOTES), ]; }