Ignore:
Timestamp:
2000-07-13T10:21:53+12:00 (24 years ago)
Author:
sjboddie
Message:

merged changes to trunk into New_Config_Format branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New_Config_Format-branch/gsdl/perllib/ghtml.pm

    r1010 r1279  
    3434sub htmlsafe
    3535{
    36     $_[0] =~ s/&/&/og;
    37     $_[0] =~ s/</&lt;/og;
    38     $_[0] =~ s/>/&gt;/og;
     36    $_[0] =~ s/&/&amp;/osg;
     37    $_[0] =~ s/</&lt;/osg;
     38    $_[0] =~ s/>/&gt;/osg;
     39    $_[0] =~ s/\"/&quot;/osg;
    3940}
    4041
     
    4546sub urlsafe
    4647{
    47     $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/ge;
     48    $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/gse;
    4849}
    4950
     
    5657sub dmsafe {
    5758    my ($s) = $_[0];
    58     $s =~ s/&/&amp;/og; # for html
    59     $s =~ s/</&lt;/og;  # for html
    60     $s =~ s/>/&gt;/og;  # for html
    61     $s =~ s/\_/&#095;/og; # for dm (we have a convention of starting macros with _
    62     $s =~ s/\"/&quot;/og; # for html (don't want to be interpreted as a quote)
    63     $s =~ s/\{/&#123;/og; # for dm blocks
    64     $s =~ s/\}/&#125;/og; # for dm blocks
     59    $s =~ s/&/&amp;/osg; # for html
     60    $s =~ s/</&lt;/osg;  # for html
     61    $s =~ s/>/&gt;/osg;  # for html
     62    $s =~ s/\_/&#095;/osg; # for dm (we have a convention of starting macros with _
     63    $s =~ s/\"/&quot;/osg; # for html (don't want to be interpreted as a quote)
     64    $s =~ s/\{/&#123;/osg; # for dm blocks
     65    $s =~ s/\}/&#125;/osg; # for dm blocks
     66    $s =~ s/\\/&#092;/osg; # for dm (dm removes naturally occurring backquotes)
    6567    return $s;
    6668}
     
    170172    # args: the text that you want to convert
    171173
    172     $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/ge;
     174    $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/gse;
    173175}
    174176
     
    177179    # args: the text that you want to convert
    178180
    179     $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/ge;
     181    $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/gse;
    180182}
    181183
Note: See TracChangeset for help on using the changeset viewer.