Changeset 11448 for trunk/gsdl


Ignore:
Timestamp:
2006-03-21T15:17:35+12:00 (18 years ago)
Author:
mdewsnip
Message:

Some more XML escaping code, for the Greenstone XML files. Hope this doesn't bugger anything else up.

File:
1 edited

Legend:

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

    r11447 r11448  
    461461        }
    462462        $source_file_chunk_text =~ s/\n$//;  # Strip the extra newline character added
     463        $source_file_chunk_text = &unmake_text_xml_safe($source_file_chunk_text);
    463464
    464465        &log_message("Source file key: $chunk_key");
     
    479480        }
    480481        $target_file_chunk_text =~ s/\n$//;  # Strip the extra newline character added
     482        $target_file_chunk_text = &unmake_text_xml_safe($target_file_chunk_text);
    481483
    482484        &log_message("Target file key: $chunk_key");
     
    791793{
    792794    my $text = shift(@_);
    793     $text =~ s/\&/\&amp\;/g;
     795    $text =~ s/\&/\&amp\;amp\;/g;
    794796    $text =~ s/</\&lt\;/g;
    795797    $text =~ s/>/\&gt\;/g;
     798    return $text;
     799}
     800
     801
     802sub unmake_text_xml_safe
     803{
     804    my $text = shift(@_);
     805    $text =~ s/\&lt\;/</g;
     806    $text =~ s/\&gt\;/>/g;
     807    $text =~ s/\&amp\;/\&/g;
    796808    return $text;
    797809}
Note: See TracChangeset for help on using the changeset viewer.