Commit d4b5e3a2 authored by anarcat's avatar anarcat Committed by Adrian Rossouw

improve the SOA parser so it tolerates multi-line SOAs and doesn't eat

non SOA records
parent da948c56
......@@ -139,7 +139,7 @@ class provisionConfig_bind_zone extends provisionConfig {
$file = $this->filename();
$body = file_get_contents($file);
$data = array();
if (preg_match('/\s\s*IN\s\s*SOA.*\((.*)\)/', $body, $matches)) {
if (preg_match('/^(?:@\s+)?IN\s+SOA\s+[\w.]+\s+[\w.]+\s+\(([^)]*)\)\s*$/ims', $body, $matches)) {
$soa = trim($matches[1]);
$SOA = preg_split('/\s\s*/', $soa);
$i = 0;
......
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