Commit b731ad71 authored by anarcat's avatar anarcat Committed by anarcat

fix delete record patterns so that delete works

we are still leaving whitespace (newlines) behind unfortunately
parent 9920e141
......@@ -110,18 +110,19 @@ class provisionService_dns_bind extends provisionService_dns {
function delete_record($zonename, $name, $type = null, $destination = null) {
$zone = $this->zone_singleton($zonename);
$pattern = "/^$name\s\s*IN\s\s*";
$pattern = "/^$name\s+IN\s+";
if (is_null($type)) {
$pattern .= "\w\w*";
$pattern .= "\w+";
} else {
$pattern .= $type;
}
$pattern .= "\s\s*";
if (!is_null($destination)) {
$pattern .= "\s+";
if (is_null($destination)) {
$pattern .= '.*';
} else {
$pattern .= $destination;
$pattern .= '$';
}
$pattern .= '/';
$pattern .= '$/im';
return $zone->delete_line($pattern);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment