--- loncom/interface/lonsupportreq.pm 2009/01/15 18:31:11 1.51 +++ loncom/interface/lonsupportreq.pm 2009/10/22 13:41:41 1.55 @@ -1,5 +1,5 @@ # -# $Id: lonsupportreq.pm,v 1.51 2009/01/15 18:31:11 bisitz Exp $ +# $Id: lonsupportreq.pm,v 1.55 2009/10/22 13:41:41 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -495,7 +495,7 @@ sub print_request_receipt { } my %lt = &Apache::lonlocal::texthash ( username => 'Name', - email => 'Email', + email => 'E-mail', cc => 'Cc', user => 'Username/domain', phone => 'Phone', @@ -566,13 +566,15 @@ END if ($env{'form.'.$item} ne '') { if ($item eq 'description') { my $descrip = $env{'form.description'}; - $descrip =~ s|\n|
|g; + $descrip = &cleanup_html($descrip); + $descrip =~ s|[\n\r\f]|
|g; $displaymsg .= ''. "$lt{$item}: $descrip
\n"; } elsif ($item eq 'sourceurl') { my $showurl = $env{'form.sourceurl'}; $showurl =~ s/\?.*$//; + $showurl = &cleanup_html($showurl); $displaymsg .= ''. "$lt{$item}: $showurl
\n"; @@ -581,9 +583,11 @@ END ''. "$lt{$item}: $okcclist
\n"; } else { + my $showitem = $env{'form.'.$item}; + $showitem = &cleanup_html($showitem); $displaymsg .= ''. - "$lt{$item}: $env{'form.'.$item}
\n"; + "$lt{$item}: $showitem
\n"; } } } @@ -746,7 +750,8 @@ END unlink($attachmentpath); } $r->print(''.$lt{'your'}.':

'."\n"); - $r->print(&Apache::lonhtmlcommon::start_pick_box('LC_helpform_receipt'). + $r->print('
'. + &Apache::lonhtmlcommon::start_pick_box(). &Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n". &Apache::lonhtmlcommon::row_closure(). &Apache::lonhtmlcommon::row_title($lt{'adin'},undef,'LC_evenrow_value')); @@ -772,7 +777,8 @@ END $envmsg =~ s/, $//; $r->print($envmsg."\n". &Apache::lonhtmlcommon::row_closure(1)."\n". - &Apache::lonhtmlcommon::end_pick_box()."\n". + &Apache::lonhtmlcommon::end_pick_box(). + "
\n". &Apache::loncommon::end_page()); } @@ -801,7 +807,11 @@ sub print_header { $r->print(<   -
  LON-CAPA $lt{'headline'} +
+ + + LON-CAPA $lt{'headline'} + @@ -842,9 +852,27 @@ sub get_domain { } elsif ($env{'request.role.domain'}) { $codedom = $env{'request.role.domain'}; } else { - $codedom = $Apache::lonnet::perlvar{'lonDefDomain'}; + $codedom = &Apache::lonnet::default_login_domain(); } return $codedom; } +sub cleanup_html { + my ($incoming) = @_; + my $outgoing; + if ($incoming ne '') { + $outgoing = $incoming; + $outgoing =~ s/\#/#/g; + $outgoing =~ s/\&/&/g; + $outgoing =~ s//>/g; + $outgoing =~ s/\(/(/g; + $outgoing =~ s/\)/)/g; + $outgoing =~ s/"/"/g; + $outgoing =~ s/'/'/g; + $outgoing =~ s/\$/$/g; + } + return $outgoing; +} + 1;