[rt-devel] attachments

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Jan 22 08:55:34 EST 2001


On Monday, January 22, 2001 14:32:06 +0100, Christian Kurz 
<Christian.Kurz at planNET.de> wrote:
+-----
| Hm, and what would be a proper code to still get the URL highlighted as
| Link but still use print_html to have a protecting against java-script?
+--->8

sub print_html{
    my ($value) = shift;
    my %map = ('<' => '&lt;', '>' => '&gt;', '&' => '&amp;');
    $value =~ s/([<>\&])/$map{$1}/ge;
    $value =~ 
s!(?:^|\b)((?:https?|ftp|mailto)://[^\s\"\'/]+/[^\s():\"\']+)!<A 
HREF=\"$1\">$1</A>!g;
    print "$value";
}

-- 
brandon s. allbery     [os/2][linux][solaris][japh]   allbery at kf8nh.apk.net
system administrator        [WAY too many hats]         allbery at ece.cmu.edu
electrical and computer engineering                                   KF8NH
carnegie mellon university     ["better check the oblivious first" -ke6sls]





More information about the Rt-devel mailing list