line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package cPanel::APIClient::Utils::FormArray; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Copyright 2020 cPanel, L. L. C. |
4
|
|
|
|
|
|
|
# All rights reserved. |
5
|
|
|
|
|
|
|
# http://cpanel.net |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the |
8
|
|
|
|
|
|
|
# same terms as Perl itself. See L. |
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
78
|
|
11
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
104
|
|
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
390
|
use URI::Escape (); |
|
3
|
|
|
|
|
1178
|
|
|
3
|
|
|
|
|
637
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub to_kv_equals_strings { |
16
|
8
|
|
|
8
|
0
|
17
|
my ($args_hr) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
return map { |
19
|
8
|
50
|
|
|
|
38
|
defined( $args_hr->{$_} ) or die "undef value ($_) is invalid!"; |
|
6
|
|
|
|
|
97
|
|
20
|
|
|
|
|
|
|
|
21
|
6
|
100
|
|
|
|
14
|
if ( 'ARRAY' eq ref $args_hr->{$_} ) { |
22
|
2
|
|
|
|
|
20
|
my $key_u = URI::Escape::uri_escape($_); |
23
|
2
|
|
|
|
|
51
|
map { "$key_u=" . URI::Escape::uri_escape($_) } @{ $args_hr->{$_} }; |
|
5
|
|
|
|
|
35
|
|
|
2
|
|
|
|
|
5
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
4
|
|
|
|
|
10
|
URI::Escape::uri_escape($_) . '=' . URI::Escape::uri_escape( $args_hr->{$_} ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} keys %$args_hr; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |