line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package URI::_userpass; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
3501
|
use strict; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
257
|
|
4
|
8
|
|
|
8
|
|
45
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
236
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
43
|
use URI::Escape qw(uri_unescape); |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
3623
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '5.21'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub user |
11
|
|
|
|
|
|
|
{ |
12
|
30
|
|
|
30
|
0
|
61
|
my $self = shift; |
13
|
30
|
|
|
|
|
73
|
my $info = $self->userinfo; |
14
|
30
|
100
|
|
|
|
67
|
if (@_) { |
15
|
8
|
|
|
|
|
17
|
my $new = shift; |
16
|
8
|
100
|
|
|
|
20
|
my $pass = defined($info) ? $info : ""; |
17
|
8
|
|
|
|
|
25
|
$pass =~ s/^[^:]*//; |
18
|
|
|
|
|
|
|
|
19
|
8
|
50
|
66
|
|
|
37
|
if (!defined($new) && !length($pass)) { |
20
|
0
|
|
|
|
|
0
|
$self->userinfo(undef); |
21
|
|
|
|
|
|
|
} else { |
22
|
8
|
100
|
|
|
|
20
|
$new = "" unless defined($new); |
23
|
8
|
|
|
|
|
11
|
$new =~ s/%/%25/g; |
24
|
8
|
|
|
|
|
13
|
$new =~ s/:/%3A/g; |
25
|
8
|
|
|
|
|
24
|
$self->userinfo("$new$pass"); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
30
|
100
|
|
|
|
73
|
return undef unless defined $info; |
29
|
22
|
|
|
|
|
58
|
$info =~ s/:.*//; |
30
|
22
|
|
|
|
|
60
|
uri_unescape($info); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub password |
34
|
|
|
|
|
|
|
{ |
35
|
18
|
|
|
18
|
0
|
30
|
my $self = shift; |
36
|
18
|
|
|
|
|
46
|
my $info = $self->userinfo; |
37
|
18
|
100
|
|
|
|
41
|
if (@_) { |
38
|
8
|
|
|
|
|
14
|
my $new = shift; |
39
|
8
|
50
|
|
|
|
31
|
my $user = defined($info) ? $info : ""; |
40
|
8
|
|
|
|
|
25
|
$user =~ s/:.*//; |
41
|
|
|
|
|
|
|
|
42
|
8
|
100
|
|
|
|
19
|
if (!defined($new)) { |
43
|
3
|
100
|
|
|
|
19
|
$self->userinfo(length $user ? $user : undef); |
44
|
|
|
|
|
|
|
} else { |
45
|
5
|
50
|
|
|
|
9
|
$new = "" unless defined($new); |
46
|
5
|
|
|
|
|
9
|
$new =~ s/%/%25/g; |
47
|
5
|
|
|
|
|
15
|
$self->userinfo("$user:$new"); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
18
|
100
|
|
|
|
42
|
return undef unless defined $info; |
51
|
15
|
100
|
|
|
|
79
|
return undef unless $info =~ s/^[^:]*://; |
52
|
12
|
|
|
|
|
32
|
uri_unescape($info); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |