Changeset 9955


Ignore:
Timestamp:
2005-05-25T17:12:39+12:00 (19 years ago)
Author:
davidb
Message:

new function, hyperlink_text added to util.pm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/util.pm

    r8716 r9955  
    623623}
    624624
     625sub hyperlink_text
     626{
     627    my ($text) = @_;
     628   
     629    $text =~ s/(http:\/\/[^\s]+)/<a href=\"$1\">$1<\/a>/mg;
     630    $text =~ s/(^|\s+)(www\.(\w|\.)+)/<a href=\"http:\/\/$2\">$2<\/a>/mg;
     631
     632    return $text;
     633}
     634
     635
    6256361;
Note: See TracChangeset for help on using the changeset viewer.