Move FQDN trim before validation in submit() method

The trim operation was happening after validation, which meant
whitespace was counted toward the max:255 validation rule. Now
input is normalized before validation, matching the pattern used
in Application and Service components.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Andras Bacsai <andrasbacsai@users.noreply.github.com>
This commit is contained in:
claude[bot] 2026-01-02 11:16:52 +00:00
parent d130030ad6
commit 5b6074c38a

View file

@ -119,13 +119,14 @@ public function submit()
return;
}
$this->validate();
// Trim FQDN to remove leading/trailing whitespace
// Trim FQDN to remove leading/trailing whitespace before validation
if ($this->fqdn) {
$this->fqdn = trim($this->fqdn);
}
$this->validate();
if ($this->settings->is_dns_validation_enabled && $this->fqdn) {
if (! validateDNSEntry($this->fqdn, $this->server)) {
$this->dispatch('error', "Validating DNS failed.<br><br>Make sure you have added the DNS records correctly.<br><br>{$this->fqdn}->{$this->server->ip}<br><br>Check this <a target='_blank' class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/dns-configuration'>documentation</a> for further help.");