Skip to content

Commit

Permalink
fix: validate and sanitize application domains
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Oct 11, 2024
1 parent 6ac70d6 commit d59d8cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Livewire/Project/Application/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ public function set_redirect()
public function submit($showToaster = true)
{
try {
Url::fromString($this->application->fqdn, ['http', 'https']);
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->trim()->explode(',')->map(function ($domain) {
Url::fromString($domain, ['http', 'https']);
return str($domain)->trim()->lower();
});
$this->application->fqdn = $this->application->fqdn->unique()->implode(',');
Expand Down

0 comments on commit d59d8cd

Please sign in to comment.