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
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
11
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
469
|
use URI::Escape (); |
|
1
|
|
|
|
|
1439
|
|
|
1
|
|
|
|
|
197
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub to_kv_equals_strings { |
16
|
1
|
|
|
1
|
0
|
3
|
my ($args_hr) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
return map { |
19
|
1
|
50
|
|
|
|
5
|
defined( $args_hr->{$_} ) or die "undef value ($_) is invalid!"; |
|
2
|
|
|
|
|
55
|
|
20
|
|
|
|
|
|
|
|
21
|
2
|
100
|
|
|
|
8
|
if ( 'ARRAY' eq ref $args_hr->{$_} ) { |
22
|
1
|
|
|
|
|
3
|
my $key_u = URI::Escape::uri_escape($_); |
23
|
1
|
|
|
|
|
10
|
map { "$key_u=" . URI::Escape::uri_escape($_) } @{ $args_hr->{$_} }; |
|
2
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
3
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
1
|
|
|
|
|
3
|
URI::Escape::uri_escape($_) . '=' . URI::Escape::uri_escape( $args_hr->{$_} ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} keys %$args_hr; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |