mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Fix escaping of % in commands http://virtualmin.com/node/36673
This commit is contained in:
@@ -1407,8 +1407,8 @@ sub extract_input
|
||||
local ($cmd) = @_;
|
||||
$cmd =~ s/\\%/\0/g;
|
||||
local ($cmd, $input) = split(/\%/, $cmd, 2);
|
||||
$cmd =~ s/\0/%/g;
|
||||
$input =~ s/\0/%/g;
|
||||
$cmd =~ s/\0/\\%/g;
|
||||
$input =~ s/\0/\\%/g;
|
||||
return ($cmd, $input);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,8 @@ else {
|
||||
&convert_range($job);
|
||||
$rangeable = 1;
|
||||
($command, $input) = &extract_input($job->{'command'});
|
||||
$command =~ s/\\%/%/g;
|
||||
$input =~ s/\\%/%/g;
|
||||
@lines = split(/%/, $input);
|
||||
print &ui_table_row($text{'edit_command'},
|
||||
&ui_textbox("cmd", $command, 60));
|
||||
|
||||
@@ -122,6 +122,8 @@ foreach $u (@ulist) {
|
||||
local $max = $config{'max_len'} || 10000;
|
||||
local ($cmd, $input) =
|
||||
&extract_input($job->{'command'});
|
||||
$cmd =~ s/\\%/%/g;
|
||||
$input =~ s/\\%/%/g;
|
||||
$cmd = length($cmd) > $max ?
|
||||
&html_escape(substr($cmd, 0, $max))." ..." :
|
||||
$cmd !~ /\S/ ? "BLANK" : &html_escape($cmd);
|
||||
|
||||
Reference in New Issue
Block a user