Skip to content

Commit

Permalink
Array option types also need to be quoted https://sourceforge.net/p/w…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Oct 27, 2015
1 parent 1760032 commit df95743
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dhcpd/edit_options.cgi
Expand Up @@ -142,12 +142,12 @@ if ($config{'dhcpd_version'} >= 3) {
print "<tr>\n";
print "<td><b>$text{'eopt_def'}</b></td><td nowrap colspan=3>\n";
print "$text{'eopt_dname'}\n";
print &ui_textbox("dname_".$i, $o->{'values'}->[0], 15);
print &ui_textbox("dname_".$i, $o->{'values'}->[0], 15);
print "$text{'eopt_dnum'}\n";
print &ui_textbox("dnum_".$i, $o->{'values'}->[2], 4);
print &ui_textbox("dnum_".$i, $o->{'values'}->[2], 4);
print "$text{'eopt_dtype'}\n";
my $a=scalar(@{$o->{'values'}})-1;
print &ui_textbox("dtype_".$i, join(" ",@{$o->{'values'}}[4..$a]), 40);
print &ui_textbox("dtype_".$i, join(" ",@{$o->{'values'}}[4..$a]), 40);
print "</td></tr>\n";
}

Expand Down
1 change: 1 addition & 0 deletions dhcpd/save_options.cgi
Expand Up @@ -149,6 +149,7 @@ if ($config{'dhcpd_version'} >= 3) {
&error(&text('sopt_ecip', $in{"cname_$i"}));
}
if ($o && $o->{'values'}->[4] eq 'string' ||
$o && $o->{'values'}->[4] eq 'array' ||
$cv !~ /^([0-9a-fA-F]{1,2}:)*[0-9a-fA-F]{1,2}$/ &&
!&check_ipaddress($cv)) {
# Quote if type is a string, or unknown and not an IP
Expand Down

0 comments on commit df95743

Please sign in to comment.