Changeset 324


Ignore:
Timestamp:
Nov 5, 2006, 12:32:22 PM (13 years ago)
Author:
Nick Burch
Message:

Do escaping and de-escaping of ' properly

Location:
trunk/npemap.org.uk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/cgi/get-reports.fcgi

    r323 r324  
    118118                        my ($postcode,$outward,$inward,$easting,$northing,$id,$source,$reason,$reporter,$reported_time) = @$row;
    119119                        # Escape the reason and email
    120                         $reason =~ s/'/"/;
    121                         $reporter =~ s/'/"/;
     120                        $reason =~ s/'/"/g;
     121                        $reporter =~ s/'/"/g;
    122122
    123123            print "addReport($id, '$postcode', $easting, $northing, [$source], ['$reason','$reporter','$reported_time']);\n";
  • trunk/npemap.org.uk/static/reportedAsProblem.html

    r322 r324  
    5555        idc.appendChild(document.createTextNode(id));
    5656
     57        // De-escape
     58        reporting[0] = reporting[0].replace(/"/g,"'");
     59        reporting[2] = reporting[2].replace(/"/g,"'");
     60        // Display
    5761        textc.appendChild(document.createTextNode(reporting[0]));
    5862        datec.appendChild(document.createTextNode(reporting[2]));
Note: See TracChangeset for help on using the changeset viewer.