From e65370e9342a9b649ad4146a401812039cdff71c Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Thu, 7 Dec 2023 23:31:01 +0100 Subject: [PATCH 1/2] Remove accidental quotes around a record, #6618 --- interface/web/dns/dns_edit_base.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/interface/web/dns/dns_edit_base.php b/interface/web/dns/dns_edit_base.php index 3d15ec1d86..9fba610eae 100644 --- a/interface/web/dns/dns_edit_base.php +++ b/interface/web/dns/dns_edit_base.php @@ -129,6 +129,12 @@ class dns_page_action extends tform_actions { if($this->checkDuplicate()) $app->tform->errorMessage .= $app->tform->lng("data_error_duplicate")."
"; + // Remove accidental quotes around a record. + $matches = array(); + if(preg_match('/"(.*)"/', $this->dataRecord["data"], $matches)) { + $this->dataRecord["data"] = $matches[1]; + } + // Set the server ID of the rr record to the same server ID as the parent record. $this->dataRecord["server_id"] = $soa["server_id"]; -- GitLab From ced00f1d00e857e4571f578facbbd6e332b824ab Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Fri, 8 Dec 2023 21:08:02 +0100 Subject: [PATCH 2/2] Limit to start and and of string --- interface/web/dns/dns_edit_base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/web/dns/dns_edit_base.php b/interface/web/dns/dns_edit_base.php index 9fba610eae..2d6d4081e7 100644 --- a/interface/web/dns/dns_edit_base.php +++ b/interface/web/dns/dns_edit_base.php @@ -131,7 +131,7 @@ class dns_page_action extends tform_actions { // Remove accidental quotes around a record. $matches = array(); - if(preg_match('/"(.*)"/', $this->dataRecord["data"], $matches)) { + if(preg_match('/^"(.*)"$/', $this->dataRecord["data"], $matches)) { $this->dataRecord["data"] = $matches[1]; } -- GitLab