X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sw-tools/blobdiff_plain/fae2108b8a8d45ebef4d49fcb0964453c2be32a7..9796a7877cd1e7f6908c678e71b8fea6045ba0e7:/perl/SWInfo.pm diff --git a/perl/SWInfo.pm b/perl/SWInfo.pm index 42c4119..4ff6e2c 100644 --- a/perl/SWInfo.pm +++ b/perl/SWInfo.pm @@ -1,6 +1,6 @@ # -*-perl-*- # -# $Id: SWInfo.pm,v 1.3 1999/08/19 12:11:10 mdw Exp $ +# $Id: SWInfo.pm,v 1.5 2004/04/08 01:52:19 mdw Exp $ # # Read and output GNU Info files # @@ -25,19 +25,6 @@ # along with sw-tools; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#----- Revision history ----------------------------------------------------- -# -# $Log: SWInfo.pm,v $ -# Revision 1.3 1999/08/19 12:11:10 mdw -# More improvements to URL recognizer. -# -# Revision 1.2 1999/08/18 17:10:07 mdw -# Slight improvements to URL and email address parsing. -# -# Revision 1.1 1999/07/30 18:46:37 mdw -# New CGI script for browsing installed software and documentation. -# - #----- Package preamble ----------------------------------------------------- package SWInfo; @@ -80,11 +67,10 @@ sub subst($$$) { # --- Transform it into something that won't get mangled --- - $node =~ s/[+&=%]|[^ -~]/sprintf("%%%02x", ord($&))/eg; - $node =~ tr/ /+/; + $node = SWCGI::sanitize($node); ($dir = $i->{dir}) =~ s:$C{prefix}/info/?::; - $dir = "&dir=$dir" if $dir; + $dir = "&dir=" . SWCGI::sanitize($dir) if $dir; return "$oref$tail"; }