Changeset 13167


Ignore:
Timestamp:
2006-10-27T12:15:07+13:00 (18 years ago)
Author:
mdewsnip
Message:

Now escapes the '&' characters in the CGI arguments in XML errors or warnings, to prevent XML parsing errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/gsdlCGI.pm

    r12707 r13167  
    8383
    8484    if ($xml) {
     85    # Make $args XML safe
     86    my $args_xml_safe = $args;
     87    $args_xml_safe =~ s/&/&/g;
     88
    8589    $full_mess =  "<Error>\n";
    8690    $full_mess .= "  $mess\n";
    87     $full_mess .= "  CGI args were: $args\n";
     91    $full_mess .= "  CGI args were: $args_xml_safe\n";
    8892    $full_mess .= "</Error>\n";
    8993    }
     
    109113
    110114    if ($xml) {
     115    # Make $args XML safe
     116    my $args_xml_safe = $args;
     117    $args_xml_safe =~ s/&/&amp;/g;
     118
    111119    $full_mess =  "<Warning>\n";
    112120    $full_mess .= "  $mess\n";
    113     $full_mess .= "  CGI args were: $args\n";
     121    $full_mess .= "  CGI args were: $args_xml_safe\n";
    114122    $full_mess .= "</Warning>\n";
    115123    }
Note: See TracChangeset for help on using the changeset viewer.