From d0cb964b0fee894570f0c7bf98d4c9852faef892 Mon Sep 17 00:00:00 2001
From: Yassine Doghri
';
diff --git a/app/Views/Components/Forms/MarkdownEditor.php b/app/Views/Components/Forms/MarkdownEditor.php
index 24c3abcc..9fab63a0 100644
--- a/app/Views/Components/Forms/MarkdownEditor.php
+++ b/app/Views/Components/Forms/MarkdownEditor.php
@@ -13,7 +13,10 @@ class MarkdownEditor extends FormComponent
$this->attributes['class'] = 'bg-elevated border-none focus:border-none focus:outline-none focus:ring-0 w-full h-full';
$this->attributes['rows'] = 6;
- $textarea = form_textarea($this->attributes, old($this->name, html_entity_decode($this->value), false));
+ // dd(htmlspecialchars_decode($this->value));
+ $value = htmlspecialchars_decode($this->value);
+
+ $textarea = form_textarea($this->attributes, old($this->name, $value, false));
$icons = [
'heading' => icon('heading'),
'bold' => icon('bold'),
diff --git a/app/Views/Components/Forms/MultiSelect.php b/app/Views/Components/Forms/MultiSelect.php
index f04d6f53..67d0efd2 100644
--- a/app/Views/Components/Forms/MultiSelect.php
+++ b/app/Views/Components/Forms/MultiSelect.php
@@ -18,12 +18,12 @@ class MultiSelect extends FormComponent
public function setOptions(string $value): void
{
- $this->options = json_decode(html_entity_decode($value), true);
+ $this->options = json_decode(htmlspecialchars_decode($value), true);
}
public function setSelected(string $selected): void
{
- $this->selected = json_decode($selected);
+ $this->selected = json_decode(htmlspecialchars_decode($selected), true);
}
public function render(): string
diff --git a/app/Views/Components/Forms/Select.php b/app/Views/Components/Forms/Select.php
index 02d6d31b..1dce3393 100644
--- a/app/Views/Components/Forms/Select.php
+++ b/app/Views/Components/Forms/Select.php
@@ -15,7 +15,7 @@ class Select extends FormComponent
public function setOptions(string $value): void
{
- $this->options = json_decode(html_entity_decode($value), true);
+ $this->options = json_decode(htmlspecialchars_decode($value), true);
}
public function render(): string
diff --git a/app/Views/Components/Forms/Textarea.php b/app/Views/Components/Forms/Textarea.php
index 9e429258..705ec0f3 100644
--- a/app/Views/Components/Forms/Textarea.php
+++ b/app/Views/Components/Forms/Textarea.php
@@ -9,7 +9,7 @@ class Textarea extends FormComponent
public function setValue(?string $value): void
{
if ($value) {
- $this->value = html_entity_decode($value);
+ $this->value = htmlspecialchars_decode($value);
}
}
diff --git a/app/Views/errors/html/error_404.php b/app/Views/errors/html/error_404.php
index 0feb6b7d..13cd3357 100644
--- a/app/Views/errors/html/error_404.php
+++ b/app/Views/errors/html/error_404.php
@@ -21,7 +21,7 @@
Sorry! Cannot seem to find the page you were looking for.