From d130030ad665999fa3449dd4a2da8ea3fd1da037 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Thu, 1 Jan 2026 10:45:13 +0000 Subject: [PATCH] Fix domain input whitespace trimming in instance settings - Add trim() to FQDN in instantSave() method to prevent whitespace from being saved - Add trim() to FQDN in submit() method before validation and DNS checks - Prevents invalid HostSNI rules caused by leading/trailing whitespace - Fixes issue where accidental whitespace from copy-paste causes deployment failures Fixes #7797 Co-authored-by: Andras Bacsai --- app/Livewire/Settings/Index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php index 7a96eabb2..98730e1a4 100644 --- a/app/Livewire/Settings/Index.php +++ b/app/Livewire/Settings/Index.php @@ -80,7 +80,7 @@ public function timezones(): array public function instantSave($isSave = true) { $this->validate(); - $this->settings->fqdn = $this->fqdn; + $this->settings->fqdn = $this->fqdn ? trim($this->fqdn) : $this->fqdn; $this->settings->public_port_min = $this->public_port_min; $this->settings->public_port_max = $this->public_port_max; $this->settings->instance_name = $this->instance_name; @@ -121,6 +121,11 @@ public function submit() } $this->validate(); + // Trim FQDN to remove leading/trailing whitespace + if ($this->fqdn) { + $this->fqdn = trim($this->fqdn); + } + if ($this->settings->is_dns_validation_enabled && $this->fqdn) { if (! validateDNSEntry($this->fqdn, $this->server)) { $this->dispatch('error', "Validating DNS failed.

Make sure you have added the DNS records correctly.

{$this->fqdn}->{$this->server->ip}

Check this documentation for further help.");