From 717ee38afef204bd7853ccf6be1d64fe6d543379 Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Mon, 6 Dec 2010 19:50:05 +0200 Subject: Use correct quotes for TXT records and escape quotes. --- config/unbound/unbound.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc index fab89742..7f2fc973 100644 --- a/config/unbound/unbound.inc +++ b/config/unbound/unbound.inc @@ -504,7 +504,8 @@ function unbound_add_host_entries() { $host_entries .= "local-data-ptr: \"{$host['ip']} {$host['host']}.{$host['domain']}\"\n"; $host_entries .= "local-data: \"{$host['host']}.{$host['domain']} IN A {$host['ip']}\"\n"; if (!empty($host['descr'])) - $host_entries .= "local-data: \"{$host['host']}.{$host['domain']} TXT '{$host['descr']}'\"\n"; + $host_entries .= "local-data: '{$host['host']}.{$host['domain']} TXT \"".addslashes($host['descr'])."\"'\n"; + // Do not add duplicate entries $added_item[$current_host] = true; } @@ -521,7 +522,7 @@ function unbound_add_host_entries() { $host_entries .= "local-data-ptr: \"{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']}\"\n"; $host_entries .= "local-data: \"{$host['hostname']}.{$syscfg['domain']} IN A {$host['ipaddr']}\"\n"; if (!empty($host['descr'])) - $host_entries .= "local-data: \"{$host['hostname']}.{$syscfg['domain']} TXT '{$host['descr']}'\"\n"; + $host_entries .= "local-data: '{$host['hostname']}.{$syscfg['domain']} TXT \"".addslashes($host['descr'])."\"'\n"; } $unbound_entries .= $host_entries; } -- cgit v1.2.3