line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
3
|
1
|
|
|
1
|
|
12
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Amon2::Auth::Util; |
6
|
1
|
|
|
1
|
|
807
|
use parent qw(Exporter); |
|
1
|
|
|
|
|
242
|
|
|
1
|
|
|
|
|
4
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw(parse_content); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# taken from OAuth::Lite2::Util |
11
|
1
|
|
|
1
|
|
1064
|
use Hash::MultiValue; |
|
1
|
|
|
|
|
2763
|
|
|
1
|
|
|
|
|
36
|
|
12
|
1
|
|
|
1
|
|
8
|
use URI::Escape qw(uri_unescape); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
210
|
|
13
|
|
|
|
|
|
|
sub parse_content { |
14
|
0
|
|
|
0
|
0
|
|
my $content = shift; |
15
|
0
|
|
|
|
|
|
my $params = Hash::MultiValue->new; |
16
|
0
|
|
|
|
|
|
for my $pair ( split /\&/, $content ) { |
17
|
0
|
|
|
|
|
|
my ( $key, $value ) = split /\=/, $pair; |
18
|
0
|
|
0
|
|
|
|
$key = uri_unescape( $key || '' ); |
19
|
0
|
|
0
|
|
|
|
$value = uri_unescape( $value || '' ); |
20
|
0
|
|
|
|
|
|
$params->add( $key, $value ); |
21
|
|
|
|
|
|
|
} |
22
|
0
|
|
|
|
|
|
return $params; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |