line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Blosxom::Plugin::Web::Request; |
2
|
4
|
|
|
4
|
|
4579
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
137
|
|
3
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
107
|
|
4
|
4
|
|
|
4
|
|
8311
|
use CGI; |
|
4
|
|
|
|
|
72213
|
|
|
4
|
|
|
|
|
32
|
|
5
|
4
|
|
|
4
|
|
273
|
use Carp qw/carp/; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
2759
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
3
|
|
|
3
|
1
|
187
|
my $self = bless {}, shift; |
9
|
3
|
|
|
|
|
28
|
$self->{query} = CGI->new; |
10
|
3
|
|
|
|
|
25236
|
$self; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
1
|
0
|
sub path_info { carp 'Not implemented yet' } |
14
|
0
|
|
|
0
|
1
|
0
|
sub base { carp 'Not implemented yet' } |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
1
|
799
|
sub header { shift->{query}->http( @_ ) } |
17
|
1
|
|
|
1
|
1
|
716
|
sub is_secure { scalar shift->{query}->https } |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
1
|
1043
|
sub method { shift->{query}->request_method } |
20
|
1
|
|
|
1
|
1
|
531
|
sub content_type { shift->{query}->content_type } |
21
|
1
|
|
|
1
|
1
|
416
|
sub referer { shift->{query}->referer } |
22
|
1
|
|
|
1
|
1
|
392
|
sub remote_host { shift->{query}->remote_host } |
23
|
1
|
|
|
1
|
1
|
584
|
sub address { shift->{query}->remote_addr } |
24
|
1
|
|
|
1
|
1
|
1384
|
sub user_agent { shift->{query}->user_agent( @_ ) } |
25
|
1
|
|
|
1
|
1
|
799
|
sub protocol { shift->{query}->server_protocol } |
26
|
1
|
|
|
1
|
1
|
358
|
sub user { shift->{query}->remote_user } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub cookie { |
29
|
2
|
|
|
2
|
1
|
5607
|
my $self = shift; |
30
|
2
|
100
|
|
|
|
16
|
return $self->{query}->cookie( shift ) if @_; |
31
|
1
|
|
|
|
|
27
|
$self->{query}->cookie; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub param { |
35
|
3
|
|
|
3
|
1
|
2733
|
my $self = shift; |
36
|
3
|
100
|
|
|
|
20
|
return $self->{query}->param( shift ) if @_; |
37
|
1
|
|
|
|
|
10
|
$self->{query}->param; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub upload { |
41
|
3
|
|
|
3
|
1
|
1408
|
my ( $self, $field ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
3
|
|
66
|
|
|
16
|
$self->{upload} ||= do { |
44
|
1
|
|
|
|
|
1158
|
require Blosxom::Plugin::Web::Request::Upload; |
45
|
1
|
|
|
|
|
4
|
my $query = $self->{query}; |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
3
|
my %upload; |
48
|
1
|
|
|
|
|
6
|
for my $field ( $query->param ) { |
49
|
4
|
|
|
|
|
26
|
my @uploads; |
50
|
4
|
|
|
|
|
83
|
for my $fh ( $query->upload($field) ) { |
51
|
5
|
|
|
|
|
605
|
my $upload = Blosxom::Plugin::Web::Request::Upload->new( |
52
|
|
|
|
|
|
|
fh => $fh, |
53
|
|
|
|
|
|
|
path => $query->tmpFileName( $fh ), |
54
|
|
|
|
|
|
|
header => $query->uploadInfo( $fh ), |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
5
|
|
|
|
|
19
|
push @uploads, $upload; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
4
|
50
|
|
|
|
23
|
$upload{ $field } = \@uploads if @uploads; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
1
|
|
|
|
|
6
|
\%upload; |
64
|
|
|
|
|
|
|
}; |
65
|
|
|
|
|
|
|
|
66
|
3
|
100
|
|
|
|
10
|
if ( $field ) { |
67
|
2
|
50
|
|
|
|
10
|
if ( my $uploads = $self->{upload}{$field} ) { |
68
|
2
|
100
|
|
|
|
9
|
return wantarray ? @{ $uploads } : $uploads->[0]; |
|
1
|
|
|
|
|
5
|
|
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
else { |
72
|
1
|
|
|
|
|
2
|
return keys %{ $self->{upload} }; |
|
1
|
|
|
|
|
11
|
|
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
0
|
return; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
3
|
|
|
3
|
|
898
|
sub DESTROY { CGI::initialize_globals() } |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |