| 1 | package Catalyst::Plugin::CGI::Untaint; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.008001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use NEXT; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use CGI::Untaint; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | our $VERSION = '0.05'; | |||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub prepare { | ||||||||
|
Subroutine
prepare: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 12 | 0 | my $class = shift; | |||||||||
| 13 | 0 | my $c = $class->NEXT::prepare( @_ ); | |||||||||
| 14 | |||||||||||
| 15 | # $c->log->debug("Creating CGI::Untaint instance"); | ||||||||||
| 16 | 0 | my $untaint = CGI::Untaint->new( $c->req->parameters ); | |||||||||
| 17 | 0 | $c->config->{__PACKAGE__}->{handler} = $untaint; | |||||||||
| 18 | 0 | $c->config->{__PACKAGE__}->{errors} = {}; | |||||||||
| 19 | |||||||||||
| 20 | 0 | return $c; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub untaint { | ||||||||
|
Subroutine
untaint: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | 0 | my ($c, @params) = @_; | |||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | if ($params[0] eq '-last_error') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | return $c->config->{__PACKAGE__}{error}{$params[1]}; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 0 | my $value = $c->config->{__PACKAGE__}{handler}->extract(@params); | |||||||||
| 31 | |||||||||||
| 32 | $c->config->{__PACKAGE__}{errors}{$params[1]} = | ||||||||||
| 33 | 0 | $c->config->{__PACKAGE__}{handler}->error; | |||||||||
| 34 | |||||||||||
| 35 | 0 | return $value; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 1 | 1; | |||||||||
| 39 | __END__ | ||||||||||