Changeset 22653 for main


Ignore:
Timestamp:
2010-08-17T16:42:14+12:00 (14 years ago)
Author:
mdewsnip
Message:

Removed dmsafe() function from ghtml.pm. This shouldn't be done in the build time code because it is a runtime issue -- if you aren't using the Greenstone 2 receptionist (e.g OAI server, Greenstone 3) then escaping underscores just creates problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/ghtml.pm

    r17058 r22653  
    6666{
    6767    $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/gse;
    68 }
    69 
    70 # dmsafe
    71 #
    72 # Converts characters which could make display.pl or html crack to their entity references.
    73 # Don't use this on dm macros as they will no longer be recognisable by dm (which
    74 # by the way, is the whole idea).
    75 # -- Rodger 12/1/98
    76 sub dmsafe {
    77     my ($s) = $_[0];
    78     $s =~ s/&/&/osg; # for html
    79     $s =~ s/</&lt;/osg;  # for html
    80     $s =~ s/>/&gt;/osg;  # for html
    81     $s =~ s/\_/&#095;/osg; # for dm (we have a convention of starting macros with _
    82     $s =~ s/\"/&quot;/osg; # for html (don't want to be interpreted as a quote)
    83     $s =~ s/\{/&#123;/osg; # for dm blocks
    84     $s =~ s/\}/&#125;/osg; # for dm blocks
    85     $s =~ s/\\/&#092;/osg; # for dm (dm removes naturally occurring backquotes)
    86     return $s;
    8768}
    8869
Note: See TracChangeset for help on using the changeset viewer.