diff --git a/group_chooser.cgi b/group_chooser.cgi index f0d240962..93cbea047 100755 --- a/group_chooser.cgi +++ b/group_chooser.cgi @@ -111,10 +111,14 @@ top.sel = sel2; top.selr = selr2; location = location; return false; } +function html_escape(s) +{ +return s.replace(/&/g, '&').replace(//g, '>'); +} for(i=0; i\n"); - document.write(""+top.sel[i]+"\n"); - document.write(""+top.selr[i]+"\n"); + document.write(""+html_escape(top.sel[i])+"\n"); + document.write(""+html_escape(top.selr[i])+"\n"); } diff --git a/user_chooser.cgi b/user_chooser.cgi index abc707abd..76b0c1d6e 100755 --- a/user_chooser.cgi +++ b/user_chooser.cgi @@ -2,6 +2,7 @@ # user_chooser.cgi # This CGI generated the HTML for choosing a user or list of users. +$trust_unknown_referers = 1; BEGIN { push(@INC, ".."); }; use WebminCore; @@ -102,10 +103,14 @@ top.sel = sel2; top.selr = selr2; top.frames[1].location = top.frames[1].location; return false; } +function html_escape(s) +{ +return s.replace(/&/g, '&').replace(//g, '>'); +} for(i=0; i\n"); - document.write(""+top.sel[i]+"\n"); - document.write(""+top.selr[i]+"\n"); + document.write(""+html_escape(top.sel[i])+"\n"); + document.write(""+html_escape(top.selr[i])+"\n"); }