Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib
In directory subversions:/tmp/cvs-serv7008
Modified Files:
ewhutil.pl
Log Message:
* Updated some utility functions to support a reference or scalar
as argument.
* Added '@' to be converted to an entity reference. Helps provide
some address obfsucation.
Index: ewhutil.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/ewhutil.pl,v
retrieving revision 2.9
retrieving revision 2.10
diff -C2 -r2.9 -r2.10
*** ewhutil.pl 25 Sep 2002 03:51:13 -0000 2.9
--- ewhutil.pl 19 Dec 2002 05:03:10 -0000 2.10
***************
*** 32,35 ****
--- 32,36 ----
'<' => '<',
'>' => '>',
+ '@' => '@',
);
***************
*** 50,63 ****
sub htmlize { # Older name
return '' unless scalar(@_) && defined($_[0]);
! my($txt) = $_[0];
! $txt =~ s/(["&<>])/$HTMLSpecials{$1}/g;
! $txt;
}
! sub entify { # Newer name
return '' unless scalar(@_) && defined($_[0]);
! my($txt) = $_[0];
! $txt =~ s/(["&<>])/$HTMLSpecials{$1}/g;
! $txt;
}
--- 51,66 ----
sub htmlize { # Older name
return '' unless scalar(@_) && defined($_[0]);
! my $txt = shift;
! my $txt_r = ref($txt) ? $txt : \$txt;
! $$txt_r =~ s/(["&<>@])/$HTMLSpecials{$1}/g;
! $$txt_r;
}
! sub entify { # Alternate name
return '' unless scalar(@_) && defined($_[0]);
! my $txt = shift;
! my $txt_r = ref($txt) ? $txt : \$txt;
! $$txt_r =~ s/(["&<>@])/$HTMLSpecials{$1}/g;
! $$txt_r;
}
***************
*** 93,101 ****
##
sub dehtmlize {
! my($str) = shift;
! $str =~ s/\</</g;
! $str =~ s/\>/>/g;
! $str =~ s/\&/\&/g;
! $str;
}
--- 96,108 ----
##
sub dehtmlize {
! my $str = shift;
! my $str_r = ref($str) ? $str : \$str;
! $$str_r =~ s/\</</g;
! $$str_r =~ s/\>/>/g;
! $$str_r =~ s/\&/\&/g;
! $$str_r =~ s/\"/\&/g;
! $$str_r =~ s/\&#[xX]0*40;/@/g;
! $$str_r =~ s/\&64;/@/g;
! $$str_r;
}
***************
*** 105,110 ****
sub urlize {
my($url) = shift || "";
! $url =~ s/([^\w(_at_)\(_dot_)\-])/sprintf("%%%X",unpack("C",$1))/ge;
! $url;
}
--- 112,118 ----
sub urlize {
my($url) = shift || "";
! my $url_r = ref($url) ? $url : \$url;
! $$url_r =~ s/([^\w\.\-])/sprintf("%%%X",unpack("C",$1))/ge;
! $$url_r;
}
---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV