From cfb5073f83fa80e5b40476b12ea91ff5114c60fc Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 5 Jan 2015 15:41:38 -0200 Subject: Fix #4090: - Unbound advanced options may contain double quotes and it breaks the syntax when a backup is restored because newlines are trimmed. Save it in base64 format is a safe way to prevent it - Bump config version to 11.5 - Provide upgrade code to encode current config or the one that came from unbound package on 2.1.5 --- usr/local/www/services_unbound.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr') diff --git a/usr/local/www/services_unbound.php b/usr/local/www/services_unbound.php index 52d976d..2b943dd 100644 --- a/usr/local/www/services_unbound.php +++ b/usr/local/www/services_unbound.php @@ -81,7 +81,7 @@ if (isset($config['unbound']['txtsupport'])) { } $pconfig['port'] = $config['unbound']['port']; -$pconfig['custom_options'] = $config['unbound']['custom_options']; +$pconfig['custom_options'] = base64_decode($config['unbound']['custom_options']); if (empty($config['unbound']['active_interface'])) { $pconfig['active_interface'] = array(); @@ -171,7 +171,7 @@ if ($_POST) { $a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']); } - $a_unboundcfg['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']); + $a_unboundcfg['custom_options'] = base64_encode(str_replace("\r\n", "\n", $_POST['custom_options'])); if (!$input_errors) { write_config("DNS Resolver configured."); -- cgit v1.1