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