Commit acbd63db authored by Franco Fichtner's avatar Franco Fichtner

dns: fix unbound custom options

PR: https://forum.opnsense.org/index.php?topic=3137.0
parent 9f801be9
...@@ -209,13 +209,9 @@ EOF; ...@@ -209,13 +209,9 @@ EOF;
unbound_acls_config(); unbound_acls_config();
// Add custom Unbound options // Add custom Unbound options
if ($config['unbound']['custom_options']) { $custom_options = '';
$custom_options = "# Unbound custom option\n"; if (!empty($config['unbound']['custom_options'])) {
foreach (preg_split('/\s+/', $config['unbound']['custom_options']) as $ent) { $custom_options = "# Unbound custom options\n{$config['unbound']['custom_options']}\n";
$custom_options .= $ent."\n";
}
} else {
$custom_options = "";
} }
// Server configuration variables // Server configuration variables
......
...@@ -242,12 +242,13 @@ include_once("head.inc"); ...@@ -242,12 +242,13 @@ include_once("head.inc");
</td> </td>
</tr> </tr>
<tr class="showadv" style="display:none"> <tr class="showadv" style="display:none">
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Advanced");?></td> <td><a id="help_for_custom_options" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext('Custom options') ?></td>
<td> <td>
<strong><?=gettext("Advanced");?><br /></strong> <textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=$pconfig['custom_options'];?></textarea>
<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=$pconfig['custom_options'];?></textarea><br /> <div class="hidden" for="help_for_custom_options">
<?=gettext("Enter any additional options you would like to add to the DNS Resolver configuration here, separated by a space or newline"); ?><br /> <?=gettext("Enter any additional options you would like to add to the DNS Resolver configuration here."); ?>
</td> </div>
</td>
</tr> </tr>
<tr class="showadv" style="display:none"> <tr class="showadv" style="display:none">
<td><a id="help_for_outgoing_interface" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Outgoing Network Interfaces"); ?></td> <td><a id="help_for_outgoing_interface" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Outgoing Network Interfaces"); ?></td>
......
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