From 8dc245393b0c94bbe22e9d4612207d4647556025 Mon Sep 17 00:00:00 2001 From: raccoon254 Date: Fri, 9 Aug 2024 08:56:03 +0300 Subject: [PATCH] Strip check all tags --- app/Livewire/BlogMaker.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Livewire/BlogMaker.php b/app/Livewire/BlogMaker.php index 7aac53d..4267a27 100644 --- a/app/Livewire/BlogMaker.php +++ b/app/Livewire/BlogMaker.php @@ -40,6 +40,12 @@ public function saveBlog(): mixed 'content' => $this->content, ]); + //check for unclosed tags + $this->contentHtml = strip_tags($this->content); + if (Str::contains($this->contentHtml, '<')) { + return redirect()->route('blog.create')->with('error', 'Please close all tags'); + } + $blogData = [ 'title' => $this->title, 'content' => $this->content,