If we're adding a TXT-record, add double quotes around the content

This commit is contained in:
Mark Schouten 2014-05-22 09:57:25 +02:00
parent d28f2b095c
commit 92e9f8c6af

View file

@ -44,13 +44,14 @@ function _do_curl($method, $opts = null, $type = 'post') {
function _create_record($name, $records, $input, $zoneurl) { function _create_record($name, $records, $input, $zoneurl) {
global $defaults; global $defaults;
$content = ($input['type'] == "TXT") ? '"'.$input['content'].'"' : $input['content'];
array_push($records, array( array_push($records, array(
'disabled' => false, 'disabled' => false,
'type' => $input['type'], 'type' => $input['type'],
'name' => $name, 'name' => $name,
'ttl' => $input['ttl'] ? $input['ttl'] : $defaults['ttl'], 'ttl' => $input['ttl'] ? $input['ttl'] : $defaults['ttl'],
'priority' => $input['priority'] ? $input['priority'] : $defaults['priority'], 'priority' => $input['priority'] ? $input['priority'] : $defaults['priority'],
'content' => $input['content'])); 'content' => $content));
$patch = array(); $patch = array();
$patch['rrsets'] = array(); $patch['rrsets'] = array();