Diff for /loncom/interface/lonsupportreq.pm between versions 1.73 and 1.74

version 1.73, 2013/07/15 16:13:21 version 1.74, 2013/11/26 03:17:06
Line 114  sub print_request_form { Line 114  sub print_request_form {
     $formname = 'logproblem';      $formname = 'logproblem';
     my $machine = &Apache::lonnet::absolute_url();      my $machine = &Apache::lonnet::absolute_url();
     my $sourceurl = $machine.$origurl;      my $sourceurl = $machine.$origurl;
     $server = $machine.&cleanup_html($origurl);      $server = $machine.&Apache::loncommon::cleanup_html($origurl);
     $server =~ s/\?.*$//;      $server =~ s/\?.*$//;
     my %lt = &Apache::lonlocal::texthash (      my %lt = &Apache::lonlocal::texthash (
                   email => 'The e-mail address you entered',                    email => 'The e-mail address you entered',
Line 676  sub print_request_receipt { Line 676  sub print_request_receipt {
         }           } 
         if (@bad_ccs == 1) {          if (@bad_ccs == 1) {
             if ($bad_ccs[0] ne '') {              if ($bad_ccs[0] ne '') {
                 $badccmsg .= '<br />'.&mt('The following Cc e-mail address is invalid: ').&cleanup_html($bad_ccs[0]);                  $badccmsg .= '<br />'.&mt('The following Cc e-mail address is invalid: ').&Apache::loncommon::cleanup_html($bad_ccs[0]);
             }              }
         } elsif (@bad_ccs > 1) {          } elsif (@bad_ccs > 1) {
             $badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: '). &cleanup_html(join(', ',@bad_ccs));              $badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: '). &Apache::loncommon::cleanup_html(join(', ',@bad_ccs));
         }          }
     }      }
     $env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'";      $env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'";
Line 702  END Line 702  END
         if ($env{'form.'.$item} ne '') {          if ($env{'form.'.$item} ne '') {
             if ($item eq 'description') {              if ($item eq 'description') {
                 my $descrip = $env{'form.description'};                  my $descrip = $env{'form.description'};
                 $descrip =  &cleanup_html($descrip);                  $descrip =  &Apache::loncommon::cleanup_html($descrip);
                 $descrip =~ s|[\n\r\f]|<br />|g;                  $descrip =~ s|[\n\r\f]|<br />|g;
                 $displaymsg .=                   $displaymsg .= 
                     '<span class="LC_helpform_receipt_cat">'.                      '<span class="LC_helpform_receipt_cat">'.
Line 710  END Line 710  END
             } elsif ($item eq 'sourceurl') {              } elsif ($item eq 'sourceurl') {
                 my $showurl = $env{'form.sourceurl'};                  my $showurl = $env{'form.sourceurl'};
                 $showurl =~ s/\?.*$//;                  $showurl =~ s/\?.*$//;
                 $showurl =  &cleanup_html($showurl);                  $showurl =  &Apache::loncommon::cleanup_html($showurl);
                 $displaymsg .=                   $displaymsg .= 
                     '<span class="LC_helpform_receipt_cat">'.                      '<span class="LC_helpform_receipt_cat">'.
                     "$lt{$item}</span>: $showurl<br />\n";                      "$lt{$item}</span>: $showurl<br />\n";
             } elsif ($item eq 'cc') {              } elsif ($item eq 'cc') {
                 if ($okcclist) {                  if ($okcclist) {
                     my $showcclist = &cleanup_html($okcclist);                      my $showcclist = &Apache::loncommon::cleanup_html($okcclist);
                     $displaymsg .=                      $displaymsg .=
                         '<span class="LC_helpform_receipt_cat">'.                          '<span class="LC_helpform_receipt_cat">'.
                         "$lt{$item}</span>: $showcclist<br />\n";                          "$lt{$item}</span>: $showcclist<br />\n";
                 }                  }
             } else {              } else {
                 my $showitem = $env{'form.'.$item};                  my $showitem = $env{'form.'.$item};
                 $showitem = &cleanup_html($showitem);                  $showitem = &Apache::loncommon::cleanup_html($showitem);
                 $displaymsg .=                   $displaymsg .= 
                     '<span class="LC_helpform_receipt_cat">'.                      '<span class="LC_helpform_receipt_cat">'.
                     "$lt{$item}</span>: $showitem<br />\n";                      "$lt{$item}</span>: $showitem<br />\n";
Line 1030  sub get_domain { Line 1030  sub get_domain {
     return $codedom;      return $codedom;
 }  }
   
 sub cleanup_html {  
     my ($incoming) = @_;  
     my $outgoing;  
     if ($incoming ne '') {  
         $outgoing = $incoming;  
         $outgoing =~ s/;/&#059;/g;  
         $outgoing =~ s/\#/&#035;/g;  
         $outgoing =~ s/\&/&#038;/g;  
         $outgoing =~ s/</&#060;/g;  
         $outgoing =~ s/>/&#062;/g;  
         $outgoing =~ s/\(/&#040/g;  
         $outgoing =~ s/\)/&#041;/g;  
         $outgoing =~ s/"/&#034;/g;  
         $outgoing =~ s/'/&#039;/g;  
         $outgoing =~ s/\$/&#036;/g;  
         $outgoing =~ s{/}{&#047;}g;  
         $outgoing =~ s/=/&#061;/g;  
         $outgoing =~ s/\\/&#092;/g  
     }  
     return $outgoing;  
 }  
   
 1;  1;

Removed from v.1.73  
changed lines
  Added in v.1.74


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>