hyperlinks in mail archives don't deal with all special html characters properly
PR: www/45184 Submitted by: Dan Langille <dan@undef.unixathome.org>
This commit is contained in:
parent
9773938266
commit
a74e3ae6d1
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=16254
1 changed files with 13 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
|||
# by John Fieber
|
||||
# February 26, 1998
|
||||
#
|
||||
# $FreeBSD: www/en/cgi/getmsg.cgi,v 1.33 2001/11/07 16:32:11 sobomax Exp $
|
||||
# $FreeBSD: www/en/cgi/getmsg.cgi,v 1.34 2002/03/19 00:53:52 peter Exp $
|
||||
#
|
||||
|
||||
require "./cgi-lib.pl";
|
||||
|
@ -205,12 +205,23 @@ sub MessageToHTML
|
|||
return $message;
|
||||
}
|
||||
|
||||
sub strip_url
|
||||
{
|
||||
my $url = shift;
|
||||
|
||||
# strip trailing characters
|
||||
$url =~ s/>?$//;
|
||||
$url =~ s/[.,;>\s]*$//;
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
sub AddAnchors
|
||||
{
|
||||
my ($text) = @_;
|
||||
my $cvsweb = 'http://cvsweb.FreeBSD.org/';
|
||||
|
||||
$text =~ s/(http|https|ftp|gopher|mailto|news|file)(:[^\s]*?\/?)(\W?\s)/<a href="$1$2">$1$2<\/a>$3/goi;
|
||||
$text =~ s/(http|https|ftp|gopher|mailto|news|file)(:[\S]*?\/?)(\W?\s)/sprintf("<a href=\"%s\">%s<\/a>$3", &strip_url("$1$2"), &strip_url("$1$2"), $3)/egoi;
|
||||
|
||||
if ($text =~ /Revision\s+Changes\s+Path/) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue