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,