line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::AuthenticationResults::Token::QuotedString; |
2
|
|
|
|
|
|
|
# ABSTRACT: Class for modelling AuthenticationResults Header parts detected as quoted strings |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
require 5.008; |
5
|
24
|
|
|
24
|
|
875
|
use strict; |
|
24
|
|
|
|
|
44
|
|
|
24
|
|
|
|
|
714
|
|
6
|
24
|
|
|
24
|
|
119
|
use warnings; |
|
24
|
|
|
|
|
39
|
|
|
24
|
|
|
|
|
900
|
|
7
|
|
|
|
|
|
|
our $VERSION = '2.20210915'; # VERSION |
8
|
24
|
|
|
24
|
|
124
|
use Carp; |
|
24
|
|
|
|
|
41
|
|
|
24
|
|
|
|
|
1180
|
|
9
|
|
|
|
|
|
|
|
10
|
24
|
|
|
24
|
|
130
|
use base 'Mail::AuthenticationResults::Token'; |
|
24
|
|
|
|
|
43
|
|
|
24
|
|
|
|
|
7248
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub is { |
14
|
192
|
|
|
192
|
1
|
293
|
my ( $self ) = @_; |
15
|
192
|
|
|
|
|
400
|
return 'string'; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub parse { |
19
|
42
|
|
|
42
|
1
|
67
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
|
21
|
42
|
|
|
|
|
61
|
my $header = $self->{ 'header' }; |
22
|
42
|
|
|
|
|
59
|
my $value = q{}; |
23
|
|
|
|
|
|
|
|
24
|
42
|
|
|
|
|
69
|
my $first = substr( $header,0,1 ); |
25
|
42
|
|
|
|
|
121
|
$header = substr( $header,1 ); |
26
|
42
|
100
|
|
|
|
118
|
croak 'not a quoted string' if $first ne '"'; |
27
|
|
|
|
|
|
|
|
28
|
41
|
|
|
|
|
64
|
my $closed = 0; |
29
|
41
|
|
|
|
|
78
|
while ( length $header > 0 ) { |
30
|
368
|
|
|
|
|
498
|
my $first = substr( $header,0,1 ); |
31
|
368
|
|
|
|
|
529
|
$header = substr( $header,1 ); |
32
|
368
|
100
|
|
|
|
584
|
if ( $first eq '"' ) { |
33
|
40
|
|
|
|
|
54
|
$closed = 1; |
34
|
40
|
|
|
|
|
58
|
last; |
35
|
|
|
|
|
|
|
} |
36
|
328
|
|
|
|
|
524
|
$value .= $first; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
41
|
100
|
|
|
|
101
|
croak 'Quoted string not closed' if ! $closed; |
40
|
|
|
|
|
|
|
|
41
|
40
|
|
|
|
|
89
|
$self->{ 'value' } = $value; |
42
|
40
|
|
|
|
|
60
|
$self->{ 'header' } = $header; |
43
|
|
|
|
|
|
|
|
44
|
40
|
|
|
|
|
74
|
return; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |