line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::AntiSpamMailTo; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
51665
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
14
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.001003'; # VERSION |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
2058
|
use HTML::Entities; |
|
3
|
|
|
|
|
125850
|
|
|
3
|
|
|
|
|
496
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $email; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub register { |
12
|
2
|
|
|
2
|
1
|
66
|
my ($self, $app) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$app->helper( |
15
|
|
|
|
|
|
|
mailto_href => sub { |
16
|
2
|
|
|
2
|
|
27524
|
shift; # dump the controller |
17
|
2
|
100
|
|
|
|
7
|
@_ and $email = shift; |
18
|
2
|
|
|
|
|
10
|
encode_entities 'mailto:' . $email, '\w\W'; |
19
|
|
|
|
|
|
|
}, |
20
|
2
|
|
|
|
|
14
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$app->helper( |
23
|
|
|
|
|
|
|
mailto => sub { |
24
|
3
|
|
|
3
|
|
971
|
shift; # dump the controller |
25
|
3
|
100
|
|
|
|
11
|
@_ and $email = shift; |
26
|
|
|
|
|
|
|
# the ''. is to ensure encode_entities doesn't modify |
27
|
|
|
|
|
|
|
# email in-place |
28
|
3
|
|
|
|
|
7
|
encode_entities ''.$email, '\w\W'; |
29
|
|
|
|
|
|
|
}, |
30
|
2
|
|
|
|
|
117
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
' |
34
|
|
|
|
|
|
|
Q: Whats the object-oriented way to become wealthy? |
35
|
|
|
|
|
|
|
A: Inheritance |
36
|
|
|
|
|
|
|
'; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |