File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,15 @@ public static function isList($array)
12
12
{
13
13
if (!is_array ($ array ))
14
14
return false ;
15
-
15
+
16
16
// TODO: generally incorrect, but it's correct given Shippo's response
17
17
foreach (array_keys ($ array ) as $ k ) {
18
18
if (!is_numeric ($ k ))
19
19
return false ;
20
20
}
21
21
return true ;
22
22
}
23
-
23
+
24
24
/**
25
25
* Recursively converts the PHP Shippo object to an array.
26
26
*
@@ -32,7 +32,7 @@ public static function convertShippoObjectToArray($values)
32
32
$ results = array ();
33
33
foreach ($ values as $ k => $ v ) {
34
34
// FIXME: this is an encapsulation violation
35
- if ($ k [0 ] == '_ ' ) {
35
+ if (is_string ( $ k ) && $ k [0 ] == '_ ' ) {
36
36
continue ;
37
37
}
38
38
if ($ v instanceof Shippo_Object) {
@@ -45,7 +45,7 @@ public static function convertShippoObjectToArray($values)
45
45
}
46
46
return $ results ;
47
47
}
48
-
48
+
49
49
/**
50
50
* Converts a response from the Shippo API to the corresponding PHP object.
51
51
*
You can’t perform that action at this time.
0 commit comments