kdig(): ignore lines starting with semicolon in json
This commit is contained in:
parent
bae5170011
commit
a65b3b24ce
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,9 @@ function kdig(string $name, string $type, string $server = NULL): array {
|
||||||
], $output, $code);
|
], $output, $code);
|
||||||
if ($code !== 0)
|
if ($code !== 0)
|
||||||
throw new KdigException($name . ' ' . $type . ' resolution failed.');
|
throw new KdigException($name . ' ' . $type . ' resolution failed.');
|
||||||
|
foreach ($output as &$line)
|
||||||
|
if (str_starts_with($line, ';'))
|
||||||
|
$line = '';
|
||||||
return json_decode(implode(LF, $output), true, flags: JSON_THROW_ON_ERROR);
|
return json_decode(implode(LF, $output), true, flags: JSON_THROW_ON_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue