Skip to content

Commit

Permalink
Strip check all tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed Aug 9, 2024
1 parent fd8c8c2 commit 8dc2453
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Livewire/BlogMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8dc2453

Please sign in to comment.