Skip to content

Commit

Permalink
fixing domain-serch format in output
Browse files Browse the repository at this point in the history
  • Loading branch information
ajatkount committed Apr 1, 2020
1 parent c72af97 commit 32fb334
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions build_isc_dhcp.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ function format_tag ($dhcp_entry=array()) {
$formatted_entry = ltrim($dhcp_entry['value']);
}
}
// Special case for domain-search
else if ($dhcp_entry['name'] == 'domain-search') {
// clean comma space
$dhcp_entry['value'] = preg_replace('/,\s+/', ',', ltrim($dhcp_entry['value']));
// clean space comma
$dhcp_entry['value'] = preg_replace('/\s,+/', ',', ltrim($dhcp_entry['value']));
// clean just a comma
$dhcp_entry['value'] = preg_replace('/,+/', '","', ltrim($dhcp_entry['value']));
// clean all whitespace and wrap final quotes around it all
$formatted_entry = '"' . preg_replace('/\s+/', '","', ltrim($dhcp_entry['value'])) . '"';
}
else if ($dhcp_entry['type'] == 'S') {
// If it is a string then quote it
$formatted_entry = '"' . $dhcp_entry['value'] . '"';
Expand Down
2 changes: 1 addition & 1 deletion plugin_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$plug_name = basename(dirname(__FILE__));

$plugin_description = 'Build ISC DHCP server configurations.';
$plugin_version = '1.5';
$plugin_version = '1.6';
$plugin_help_url = 'https://github.com/opennetadmin/'.$plug_name.'/wiki';


Expand Down

0 comments on commit 32fb334

Please sign in to comment.