| 1 | package URI::_userpass; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 17 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 17 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 17 | ▶ | use URI::Escape qw(uri_unescape); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 17 | our $VERSION = '5.40'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 33 | ▶ | sub user { | ||||||||||||||||||||||||||
|
Subroutine
user: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 33 | my $self = shift; | |||||||||||||||||||||||||||
| 12 | 33 | my $info = $self->userinfo; | |||||||||||||||||||||||||||
| 13 | 33 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 14 | 8 | my $new = shift; | |||||||||||||||||||||||||||
| 15 | 8 | ▶ | my $pass = defined($info) ? $info : ""; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | 8 | $pass =~ s/^[^:]*//; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 8 | ▶ | if (!defined($new) && !length($pass)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $new || length $pass
MC/DC0%0/2
defined $new || length $pass
defined $new
length $pass
Truth table66%2/3
A || B
A= defined $newB= length $pass
| |||||||||||||||||||||||||||||
| 19 | 0 | $self->userinfo(undef); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | else { | ||||||||||||||||||||||||||||
| 22 | 8 | ▶ | $new = "" unless defined($new); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 8 | $new =~ s/%/%25/g; | |||||||||||||||||||||||||||
| 24 | 8 | $new =~ s/:/%3A/g; | |||||||||||||||||||||||||||
| 25 | 8 | $self->userinfo("$new$pass"); | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 33 | ▶ | return undef unless defined $info; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 25 | $info =~ s/:.*//; | |||||||||||||||||||||||||||
| 30 | 25 | uri_unescape($info); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 29 | ▶ | sub password { | ||||||||||||||||||||||||||
|
Subroutine
password: called CC=8 SCAR=20.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | 29 | my $self = shift; | |||||||||||||||||||||||||||
| 35 | 29 | my $info = $self->userinfo; | |||||||||||||||||||||||||||
| 36 | 29 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 9 | my $new = shift; | |||||||||||||||||||||||||||
| 38 | 9 | ▶ | my $user = defined($info) ? $info : ""; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | 9 | $user =~ s/:.*//; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 9 | ▶ | if (!defined($new)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 3 | ▶ | $self->userinfo(length $user ? $user : undef); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | else { | ||||||||||||||||||||||||||||
| 45 | 6 | ▶ | $new = "" unless defined($new); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | 6 | $new =~ s/%/%25/g; | |||||||||||||||||||||||||||
| 47 | 6 | $self->userinfo("$user:$new"); | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | 29 | ▶ | return undef unless defined $info; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | 25 | ▶ | return undef unless $info =~ s/^[^:]*://; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | 17 | uri_unescape($info); | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 17 | 1; | |||||||||||||||||||||||||||