From cc4adf7126d70e0fc490d60d29c9c4dabafb339c Mon Sep 17 00:00:00 2001 From: LukaszKurpanik Date: Mon, 3 Jun 2024 13:09:30 +0200 Subject: [PATCH] dodatkowe sprawdzanie czy edd_options istnieje i jest array --- includes/cart/actions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/cart/actions.php b/includes/cart/actions.php index a71a59ff72c..75f1ae94dbe 100644 --- a/includes/cart/actions.php +++ b/includes/cart/actions.php @@ -65,9 +65,10 @@ function edd_process_cart_endpoints() { */ function edd_process_add_to_cart( $data ) { $download_id = absint( $data['download_id'] ); - $options = isset( $data['edd_options'] ) ? $data['edd_options'] : array(); - if ( ! empty( $data['edd_download_quantity'] ) ) { + $options = (isset($data['edd_options']) && is_array($data['edd_options'])) ? $data['edd_options'] : array(); + + if ( ! empty( $data['edd_download_quantity'] ) ) { $options['quantity'] = absint( $data['edd_download_quantity'] ); }