[Affelio-cvs 212] CVS update: affelio/lib/Affelio/misc

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 6月 28日 (火) 01:15:10 JST


Index: affelio/lib/Affelio/misc/WebInput.pm
diff -u affelio/lib/Affelio/misc/WebInput.pm:1.3 affelio/lib/Affelio/misc/WebInput.pm:1.4
--- affelio/lib/Affelio/misc/WebInput.pm:1.3	Sat Jun 25 21:14:08 2005
+++ affelio/lib/Affelio/misc/WebInput.pm	Tue Jun 28 01:15:10 2005
@@ -4,7 +4,7 @@
 #    http://affelio.jp/ (Japan)
 #    http://affelio.jp/ (USA and other area)
 #
-# $Id: WebInput.pm,v 1.3 2005/06/25 12:14:08 slash5234 Exp $
+# $Id: WebInput.pm,v 1.4 2005/06/27 16:15:10 slash5234 Exp $
 use strict;
 
 package Affelio::misc::WebInput;
@@ -120,14 +120,26 @@
        my @http = $in =~ /s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+/g;#'
        return($http[0]);
     }
+
+    ######################################################################
+    sub translate_URL_to_HTML{
+	my $self = shift;
+	my $in = shift;
+
+       $in =~ s/(s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/<A HREF="$1">$1<\/A>/g;#'
+       return($in);
+    }
     
 
     ######################################################################
     sub distill_URL{
        my $text = shift;
-       my @http = $text =~ /s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+/g;
+       if($text =~ /(s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/){ #'
+           return($1);
+       }else{
+           return("");
+       }
 
-       return($http[0]);
     }
 
     ######################################################################


Affelio-cvs メーリングリストの案内
Back to archive index