Handle parent directories links, e.g.:
ports/japanese/ppxp/../../net/ppxp/pkg/DESCR -> ports/net/ppxp/pkg/DESCR
This commit is contained in:
parent
61006efd6b
commit
c62a541970
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=4163
1 changed files with 6 additions and 1 deletions
|
@ -26,7 +26,7 @@
|
||||||
#
|
#
|
||||||
# url.cgi - make plain text URLs clickable
|
# url.cgi - make plain text URLs clickable
|
||||||
#
|
#
|
||||||
# $Id: url.cgi,v 1.14 1999-01-22 23:57:55 wosch Exp $
|
# $Id: url.cgi,v 1.15 1999-02-01 14:27:03 wosch Exp $
|
||||||
|
|
||||||
|
|
||||||
$hsty_base = '';
|
$hsty_base = '';
|
||||||
|
@ -43,6 +43,11 @@ if ($file !~ m%^(http|ftp)://[a-z_\-0-9]+\.freebsd\.(com|org)%i) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# catch '..', multiple times
|
||||||
|
# ports/japanese/ppxp/../../net/ppxp/pkg/DESCR
|
||||||
|
# -> ports/net/ppxp/pkg/DESCR
|
||||||
|
1 while $file =~ s%/[^/]+/\.\./%/%;
|
||||||
|
|
||||||
my($cvsroot) = '/home/ncvs';
|
my($cvsroot) = '/home/ncvs';
|
||||||
$file =~ s%(http|ftp)://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/%%;
|
$file =~ s%(http|ftp)://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/%%;
|
||||||
print &short_html_header($file);
|
print &short_html_header($file);
|
||||||
|
|
Loading…
Reference in a new issue