mirror of
https://github.com/webmin/webmin.git
synced 2025-08-19 01:15:14 +00:00
Fix format_config
test
This commit is contained in:
@ -26,7 +26,7 @@ print &ui_form_start("allmanual_save.cgi", "form-data");
|
||||
print &ui_hidden("file", $in{'file'}),"\n";
|
||||
|
||||
# Display nicely too
|
||||
if ($config{'format_config'}) {
|
||||
if ($config{'format_config'} ne '0') {
|
||||
$data = &read_file_lines($in{'file'}, 1);
|
||||
&format_config($data);
|
||||
$data = join("\n", @{$data});
|
||||
|
@ -27,7 +27,7 @@ if ($config{'test_manual'}) {
|
||||
}
|
||||
}
|
||||
unlink($temp);
|
||||
&format_config_file($in{'file'}) if ($config{'format_config'});
|
||||
&format_config_file($in{'file'}) if ($config{'format_config'} ne '0');
|
||||
&webmin_log("manual", undef, undef, { 'file' => $in{'file'} });
|
||||
&redirect("index.cgi?mode=global");
|
||||
|
||||
|
@ -2219,7 +2219,7 @@ sub format_modifed_config_files
|
||||
{
|
||||
my ($conf_already_tested) = @_;
|
||||
if($saved_conf_files) {
|
||||
if ($config{'format_config'}) {
|
||||
if ($config{'format_config'} ne '0') {
|
||||
# Test config first if not already
|
||||
# tested and don't format on error
|
||||
if (!$conf_already_tested) {
|
||||
|
@ -93,7 +93,7 @@ for($i=$start; $i<=$end; $i++) {
|
||||
}
|
||||
|
||||
# Display nicely too
|
||||
if ($config{'format_config'}) {
|
||||
if ($config{'format_config'} ne '0') {
|
||||
&format_config(\@buf);
|
||||
}
|
||||
$buf = join("\n", @buf);
|
||||
|
@ -64,7 +64,7 @@ if (!defined($start)) {
|
||||
$end = @$lref - 1;
|
||||
}
|
||||
splice(@$lref, $start, $end-$start+1, @dirs);
|
||||
&format_config($lref) if ($config{'format_config'});
|
||||
&format_config($lref) if ($config{'format_config'} ne '0');
|
||||
&flush_file_lines();
|
||||
if ($config{'test_manual'}) {
|
||||
$err = &test_config();
|
||||
|
Reference in New Issue
Block a user