mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
fix: add numeric check before converting items to integers
Prevents "Object could not be converted to int" notice when items array contains objects.
This commit is contained in:
parent
afd39b28df
commit
3f3c43ed2e
1 changed files with 1 additions and 1 deletions
|
@ -393,7 +393,7 @@ class OrderTrackingEndpoint {
|
|||
'carrier_name_other' => $data['carrier_name_other'] ?? '',
|
||||
);
|
||||
|
||||
if ( ! empty( $data['items'] ) ) {
|
||||
if ( ! empty( $data['items'] ) && is_numeric( reset( $data['items'] ) ) ) {
|
||||
$tracking_info['items'] = array_map( 'intval', $data['items'] );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue