Changeset 11238


Ignore:
Timestamp:
2006-02-13T11:55:10+13:00 (18 years ago)
Author:
mdewsnip
Message:

Now escapes all '&' characters, to prevent problems with undefined entities. This could cause problems if the exploded metadata already contains entities (which will be escaped again).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/explode_metadata_database.pl

    r10999 r11238  
    303303
    304304    # Make $value XML-safe
     305    $value =~ s/&/&/g;  # May mess up existing entities!
    305306    $value =~ s/</&lt;/g;
    306307    $value =~ s/>/&gt;/g;
     
    310311    # should we be checking for them too?
    311312    # this may not get all possibilities
    312     $value =~ s/&([^;\s]*(\s|$))/&amp;$1/g;
     313    # $value =~ s/&([^;\s]*(\s|$))/&amp;$1/g;
    313314
    314315    print $metadata_xml_file "      <Metadata mode=\"accumulate\" name=\"$meta_prefix$field\">$value</Metadata>\n";
Note: See TracChangeset for help on using the changeset viewer.