mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Handle user and group names with spaces in them https://sourceforge.net/p/webadmin/bugs/5011/
This commit is contained in:
@@ -25,7 +25,7 @@ if ($in{'multi'}) {
|
||||
# base frame
|
||||
&PrintHeader();
|
||||
print "<script type='text/javascript'>\n";
|
||||
@ul = &split_quoted(&filter_javascript($in{'group'}));
|
||||
@ul = &split_quoted_string(&filter_javascript($in{'group'}));
|
||||
$len = @ul;
|
||||
print "sel = new Array($len);\n";
|
||||
print "selr = new Array($len);\n";
|
||||
@@ -207,17 +207,3 @@ endgrent() if ($gconfig{'os_type'} ne 'hpux');
|
||||
return sort { $a->[0] cmp $b->[0] } @groups;
|
||||
}
|
||||
|
||||
# split_quoted(string)
|
||||
sub split_quoted
|
||||
{
|
||||
local @rv;
|
||||
local $str = $_[0];
|
||||
while($str =~ /^\s*(\S*"[^"]+"\S*)(.*)$/ || $str =~ /^\s*(\S+)(.*)$/) {
|
||||
$str = $2;
|
||||
local $g = $1;
|
||||
$g =~ s/"//g;
|
||||
push(@rv, $g);
|
||||
}
|
||||
return @rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ if ($in{'multi'}) {
|
||||
# base frame
|
||||
&PrintHeader();
|
||||
print "<script type='text/javascript'>\n";
|
||||
@ul = split(/\s+/, &filter_javascript($in{'user'}));
|
||||
@ul = &split_quoted_string(/\s+/, &filter_javascript($in{'user'}));
|
||||
$len = @ul;
|
||||
print "sel = new Array($len);\n";
|
||||
print "selr = new Array($len);\n";
|
||||
|
||||
Reference in New Issue
Block a user