diff --git a/index.cgi b/index.cgi
index fccbf928..7ed56b0b 100755
--- a/index.cgi
+++ b/index.cgi
@@ -62,10 +62,11 @@ elsif ($gconfig{"notabs_${base_remote_user}"} == 2 ||
if ($pos % $cols == 0) { print "
\n"; }
print "\n";
local $idx = $m->{'index_link'};
- print "{'dir'}/$idx>",
+ my $alink = &urlize("$gconfig{'webprefix'}/$m->{'dir'}/$idx");
+ print "\n";
- print "{'dir'}/$idx>$m->{'desc'} | \n";
+ print "@{[&html_escape($m->{'desc'})]}\n";
if ($pos % $cols == $cols - 1) { print " \n"; }
$pos++;
}
@@ -128,7 +129,7 @@ else {
print "", $usercol ? " " :
""," | \n";
print " ",
- "$t | \n";
+ "@{[&html_escape($t)]} \n";
print "", $usercol ? " " :
""," | \n";
}
@@ -147,10 +148,11 @@ else {
if ($pos % $cols == 0) { print "\n"; }
print "\n";
- print "{'dir'}/>",
+ my $mlink = &urlize("$gconfig{'webprefix'}/$m->{'dir'}/");
+ print "\n";
- print "{'dir'}/>$m->{'desc'} | \n";
+ print "@{[&html_escape($m->{'desc'})]}\n";
if ($pos++ % $cols == $cols - 1) { print " \n"; }
}
while($pos++ % $cols) {
diff --git a/mailbox/list_folders.cgi b/mailbox/list_folders.cgi
index d891ee7e..0e41762e 100755
--- a/mailbox/list_folders.cgi
+++ b/mailbox/list_folders.cgi
@@ -28,18 +28,23 @@ print &ui_hidden_end("instr");
print &ui_form_start("delete_folders.cgi", "post");
my @tds = ( "width=5" );
my @folders = &list_folders_sorted();
+foreach my $folder (@folders) {
+ $folder->{'file'} = &html_escape($folder->{'file'})
+ if ($folder->{'file'});
+ }
print &ui_columns_start([ "",
$text{'folders_name'},
$text{'folders_path'},
$text{'folders_type'},
$text{'folders_size'},
$text{'folders_action'} ], undef, 0, \@tds);
+ # var_dump(\@folders);
foreach my $f (@folders) {
my @cols;
my $deletable = 0;
if ($f->{'inbox'} || $f->{'drafts'} || $f->{'spam'}) {
# Inbox, drafs or spam folder which cannot be edited
- push(@cols, $f->{'name'});
+ push(@cols, &html_escape($f->{'name'}));
}
elsif ($f->{'type'} == 2) {
# Link for editing POP3 folder
diff --git a/mailbox/list_ifolders.cgi b/mailbox/list_ifolders.cgi
index 807e398c..9f3e92b9 100755
--- a/mailbox/list_ifolders.cgi
+++ b/mailbox/list_ifolders.cgi
@@ -12,6 +12,10 @@ require './mailbox-lib.pl';
print &ui_form_start("delete_folders.cgi", "post");
my @tds = ( "width=5" );
my @folders = &list_folders_sorted();
+foreach my $folder (@folders) {
+ $folder->{'file'} = &html_escape($folder->{'file'})
+ if ($folder->{'file'});
+ }
my @adders = ( "$text{'folders_addimap'}",
"$text{'folders_addcomp'}",
"$text{'folders_addvirt'}" );
diff --git a/mailbox/reply_mail.cgi b/mailbox/reply_mail.cgi
index 707dcfae..ec655d27 100755
--- a/mailbox/reply_mail.cgi
+++ b/mailbox/reply_mail.cgi
@@ -809,8 +809,9 @@ print &ui_table_start($text{'reply_body'}, "width=100%", 2, undef,
# Process email quote
my $iframe_quote;
$iframe_quote = &iframe_quote($quote)
- if (!$in{'new'});
-
+ if (!$in{'new'} && !$in{'enew'});
+my $draft;
+$draft = $quote if ($in{'enew'});
if ($html_edit) {
# Get HTML editor and replies
@@ -832,7 +833,7 @@ if ($html_edit) {
$sig = "
$sig
"
if ($sig);
print &ui_table_row(undef,
- &ui_textarea("body", $sig, 16, 80, undef, 0,
+ &ui_textarea("body", $draft || $sig, 16, 80, undef, 0,
"style='display: none' id=body data-html-mode='$userconfig{'html_edit_mode'}'").
$html_editor, 2);
}
@@ -842,7 +843,7 @@ else {
$wm =~ s/^wrap=//g;
my $wcols = $userconfig{'wrap_compose'};
print &ui_table_row(undef,
- &ui_textarea("body", "\n\n$sig\n\n$quote", 16,
+ &ui_textarea("body", "\n".$draft || "\n\n$sig\n\n$quote", 16,
$wcols || 80,
$wcols ? "hard" : "",
0,
diff --git a/mailbox/view_mail.cgi b/mailbox/view_mail.cgi
index 819e71bd..35dd3d61 100755
--- a/mailbox/view_mail.cgi
+++ b/mailbox/view_mail.cgi
@@ -521,15 +521,15 @@ if (!@sub) {
if ($mail->{'sortidx'} != 0) {
my $mailprv = $beside[$prv];
$left = "view_mail.cgi?id=".&urlize($mailprv->{'id'}).
- "&folder=$in{'folder'}&start=$in{'start'}";
+ "&folder=@{[&urlize($in{'folder'})]}&start=$in{'start'}";
}
if ($mail->{'sortidx'} < $c-1) {
my $mailnxt = $beside[$nxt];
$right = "view_mail.cgi?id=".&urlize($mailnxt->{'id'}).
- "&folder=$in{'folder'}&start=$in{'start'}";
+ "&folder=@{[&urlize($in{'folder'})]}&start=$in{'start'}";
}
print &ui_page_flipper(&text('view_desc', $mail->{'sortidx'}+1,
- $folder->{'name'}),
+ &html_escape($folder->{'name'})),
undef, undef, $left, $right);
}
else {
diff --git a/mailbox/webmin_menu.pl b/mailbox/webmin_menu.pl
index d1693106..2a1fd9d0 100644
--- a/mailbox/webmin_menu.pl
+++ b/mailbox/webmin_menu.pl
@@ -51,7 +51,7 @@ sub list_webmin_menu
my $item = { 'type' => 'item',
'id' => 'folder_'.$fid,
'folder' => 1,
- 'desc' => $f->{'name'},
+ 'desc' => &html_escape($f->{'name'}),
'link' => '/'.$module_name.
'/index.cgi?id='.&urlize($fid) };
if ($f->{'type'} == 6 &&
diff --git a/ssh/list_auths.cgi b/ssh/list_auths.cgi
index e9c6066a..7bdfbef9 100755
--- a/ssh/list_auths.cgi
+++ b/ssh/list_auths.cgi
@@ -17,7 +17,7 @@ if (@auths) {
foreach $a (@auths) {
print &ui_columns_row([
"".
- "$a->{'name'}",
+ "@{[&html_escape($a->{'name'})]}",
"".substr($a->{'key'}, 0, 40)." ... ".
substr($a->{'key'}, -40)."",
]);
diff --git a/ssh/list_hosts.cgi b/ssh/list_hosts.cgi
index 9de07948..f17779ab 100755
--- a/ssh/list_hosts.cgi
+++ b/ssh/list_hosts.cgi
@@ -11,7 +11,7 @@ foreach $h (@$hconf) {
if (lc($h->{'name'}) eq 'host') {
push(@links, "edit_host.cgi?idx=$i");
push(@icons, "images/host.gif");
- push(@titles, $h->{'values'}->[0] eq '*' ? "$text{'hosts_all'}" : $h->{'values'}->[0]);
+ push(@titles, $h->{'values'}->[0] eq '*' ? "$text{'hosts_all'}" : &html_escape($h->{'values'}->[0]));
}
$i++;
}
|
|