| 1 | package Mojolicious::Plugin::AntiSpamMailTo; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use Mojo::Base 'Mojolicious::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 4 | our $VERSION = '1.001004'; # VERSION | |||||||||
| 6 | |||||||||||
| 7 | 4 | ▶ | use HTML::Entities; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 4 | my $email; | |||||||||
| 10 | |||||||||||
| 11 | 2 | ▶ | sub register { | ||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 12 | 2 | my ($self, $app) = @_; | |||||||||
| 13 | |||||||||||
| 14 | $app->helper( | ||||||||||
| 15 | 2 | ▶ | mailto_href => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 16 | 2 | shift; # dump the controller | |||||||||
| 17 | 2 | ▶ | @_ and $email = shift; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 2 | encode_entities 'mailto:' . $email, '\w\W'; | |||||||||
| 19 | }, | ||||||||||
| 20 | 2 | ); | |||||||||
| 21 | |||||||||||
| 22 | $app->helper( | ||||||||||
| 23 | 3 | ▶ | mailto => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 24 | 3 | shift; # dump the controller | |||||||||
| 25 | 3 | ▶ | @_ and $email = shift; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | # the ''. is to ensure encode_entities doesn't modify | ||||||||||
| 27 | # email in-place | ||||||||||
| 28 | 3 | encode_entities ''.$email, '\w\W'; | |||||||||
| 29 | }, | ||||||||||
| 30 | 2 | ); | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 4 | ' | |||||||||
| 34 | Q: Whats the object-oriented way to become wealthy? | ||||||||||
| 35 | A: Inheritance | ||||||||||
| 36 | '; | ||||||||||
| 37 | |||||||||||
| 38 | __END__ | ||||||||||