Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv3846
Modified Files:
Tag: v0/18/1
MailParse.pm
Log Message:
fix bug with protocol-less href's
Index: MailParse.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/MailParse.pm,v
retrieving revision 1.91.2.1
retrieving revision 1.91.2.2
diff -C2 -d -r1.91.2.1 -r1.91.2.2
*** MailParse.pm 11 Mar 2003 08:08:00 -0000 1.91.2.1
--- MailParse.pm 10 Apr 2003 22:11:23 -0000 1.91.2.2
***************
*** 379,399 ****
# Tags with href attributes
!
if ( $attribute =~ /^href$/i && $tag =~ /^(a|link|base|area)$/i ) {
! # ftp, http, https
! if ( $value =~ /^(ftp|http|https):\/\//i ) {
! add_url($self, $value, $encoded, $quote, $end_quote, '');
! next;
}
-
- # The less common mailto: goes second, and we only care if this is in an anchor
! if ( $tag =~ /^a$/ && $value =~ /^mailto:([[:alpha:]0-9\-_\.]+?@([[:alpha:]0-9\-_\.]+?))([>\&\?\:\/]|$)/i ) {
! update_word( $self, $1, $encoded, 'mailto:', ($3?'[\\\>\&\?\:\/]':$end_quote), '' );
! add_url( $self, $2, $encoded, '@', ($3?'[\\\&\?\:\/]':$end_quote), '' );
! }
! next;
}
--- 379,399 ----
# Tags with href attributes
!
if ( $attribute =~ /^href$/i && $tag =~ /^(a|link|base|area)$/i ) {
! # Look for mailto:'s
! if ($value =~ /^mailto:/i) {
! if ( $tag =~ /^a$/ && $value =~ /^mailto:([[:alpha:]0-9\-_\.]+?@([[:alpha:]0-9\-_\.]+?))([>\&\?\:\/]|$)/i ) {
! update_word( $self, $1, $encoded, 'mailto:', ($3?'[\\\>\&\?\:\/]':$end_quote), '' );
! add_url( $self, $2, $encoded, '@', ($3?'[\\\&\?\:\/]':$end_quote), '' );
! }
! } else {
! # Anything that isn't a mailto is probably an URL
!
! $self->add_url($value, $encoded, $quote, $end_quote, '');
}
! next;
}
|