root/Apache-AntiSpam/trunk/lib/Apache/AntiSpam/HTMLEncode.pm

Revision 94 (checked in by miyagawa, 19 years ago)

fixed documentation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 package Apache::AntiSpam::HTMLEncode;
2
3 use strict;
4 use vars qw($VERSION);
5 $VERSION = '0.01';
6
7 use Apache::AntiSpam;
8 use base qw(Apache::AntiSpam);
9 use HTML::Entities;
10
11 sub antispamize {
12     my($class, $email, $orig) = @_;
13     return encode_entities($orig, '\x00-\xff');
14 }   
15
16 1;
17 __END__
18
19 =head1 NAME
20
21 Apache::AntiSpam::HTMLEncode - Encodes E-mail addresses with HTML
22
23 =head1 SYNOPSIS
24
25   # in httpd.conf
26   <Location /antispam>
27   SetHandler perl-script
28   PerlHandler Apache::AntiSpam::HTMLEncode
29   </Location>
30
31   # filter aware
32   PerlModule Apache::Filter
33   SetHandler perl-script
34   PerlSetVar Filter On
35   PerlHandler Apache::RegistryFilter Apache::AntiSpam::HTMLEncode Apache::Compress
36
37 =head1 DESCRIPTION
38
39 Apache::AntiSpam::HTMLEncode is a subclass of Apache::AntiSpam, filter
40 module to prevent e-mail addresses exposed as is on web pages. This
41 module encodes e-mail addresses with HTML.
42
43 For example, C<miyagawa@cpan.org> will be filtered to
44 C<&#109;&#105;&#121;&#97;&#103;&#97;&#119;&#97;&#64;&#99;&#112;&#97;&#110;&#46;&#111;&#114;&#103>.
45
46 This won't affect anything on your favourite browsers, but spammers
47 with crawling-robot plus pattern matching technique won't be able to
48 extract addresses from this kind of format.
49
50 This module is Filter aware, meaning that it can work within
51 Apache::Filter framework without modification.
52
53 =head1 ACKNOWLEDGEMENT
54
55 The idea to encode E-mail address with HTML is stolen from
56 http://perlmonks.org/?node_id=89810
57
58 =head1 AUTHOR
59
60 Tatsuhiko Miyagawa <miyagawa@bulknews.net>
61
62 This library is free software; you can redistribute it and/or modify
63 it under the same terms as Perl itself.
64
65 =head1 SEE ALSO
66
67 L<Apache::AntiSpam>
68
69 =cut
Note: See TracBrowser for help on using the browser.