Don't un-comment or use cace_dir entries that are not paths https://sourceforge.net/p/webadmin/bugs/4523/

This commit is contained in:
Jamie Cameron
2015-03-04 11:25:54 -08:00
parent b33a605699
commit e11ef0ed93
2 changed files with 14 additions and 2 deletions

View File

@@ -35,8 +35,15 @@ if (!$in{'nouser'}) {
&flush_file_lines();
}
# If cache_dir is set but disabled, enable it
# If cache_dir is set but disabled, enable it by un-commenting (but only the
# valid directives)
my @cachestruct = &find_config("cache_dir", $conf, 2);
if ($squid_version >= 2.3) {
@cachestruct = map { $_->{'values'}->[1] } @cachestruct;
}
else {
@cachestruct = map { $_->{'values'}->[0] } @cachestruct;
}
if (@cachestruct) {
&save_directive($conf, "cache_dir", \@cachestruct);
&flush_file_lines();

View File

@@ -454,7 +454,12 @@ foreach my $d ("cache_access_log", "access_log", "cache_log",
# add cache directories
if (my @str = &find_config("cache_dir", $conf)) {
foreach my $str (@str) {
push(@list, $str->{'values'}->[0]);
if ($squid_version >= 2.3) {
push(@list, $str->{'values'}->[1]);
}
else {
push(@list, $str->{'values'}->[0]);
}
}
}
else {