Merge pull request #4288 from retrymp3/XSS-vuln-fix
This commit is contained in:
commit
fba1242213
1 changed files with 2 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ public function submit()
|
|||
$this->validate();
|
||||
$tags = str($this->newTags)->trim()->explode(' ');
|
||||
foreach ($tags as $tag) {
|
||||
$tag = strip_tags($tag);
|
||||
if (strlen($tag) < 2) {
|
||||
$this->dispatch('error', 'Invalid tag.', "Tag <span class='dark:text-warning'>$tag</span> is invalid. Min length is 2.");
|
||||
|
||||
|
|
@ -65,6 +66,7 @@ public function submit()
|
|||
public function addTag(string $id, string $name)
|
||||
{
|
||||
try {
|
||||
$name = strip_tags($name);
|
||||
if ($this->resource->tags()->where('id', $id)->exists()) {
|
||||
$this->dispatch('error', 'Duplicate tags.', "Tag <span class='dark:text-warning'>$name</span> already added.");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue